Skip to content

Commit

Permalink
Revert "Merge remote-tracking branch 'origin/dev' into merge_current_…
Browse files Browse the repository at this point in the history
…dev"

This reverts commit 63fd0cc, reversing
changes made to dba3559.
  • Loading branch information
carlosferreyra committed Sep 4, 2024
1 parent 63fd0cc commit b56cb2b
Show file tree
Hide file tree
Showing 41 changed files with 579 additions and 1,385 deletions.
24 changes: 0 additions & 24 deletions FrontAdmin/src/API/DatosAlumnosV2.ts

This file was deleted.

24 changes: 0 additions & 24 deletions FrontAdmin/src/API/DetalleAlumno.ts

This file was deleted.

1 change: 0 additions & 1 deletion FrontAdmin/src/API/Materias.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import Cookies from 'js-cookie';
const URL= import.meta.env.VITE_URL_DEV;

Check warning on line 2 in FrontAdmin/src/API/Materias.ts

View workflow job for this annotation

GitHub Actions / Linter de Código

Insert `·`

Check warning on line 2 in FrontAdmin/src/API/Materias.ts

View workflow job for this annotation

GitHub Actions / Linter de Código

Insert `·`

Expand Down
30 changes: 2 additions & 28 deletions FrontAdmin/src/API/Montos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ export const FetchMontos = async (offset: number, limit:number ) => {
}
};

export const createCompromiso = async (compromisoData: any, selectFile: any) => {
export const createCompromiso = async (compromisoData: any) => {
try {
const token = Cookies.get('access_token');
console.log(compromisoData);

const response = await fetch(`${URL}/pagos/compromisos/`, {
method: 'POST',
Expand All @@ -43,7 +44,6 @@ export const createCompromiso = async (compromisoData: any, selectFile: any) =>

if (response.ok) {
const data = await response.json();
await loadPDF(data.id_comp_pago ,selectFile);
return data;
} else {
const errorResponse = await response.json();
Expand All @@ -53,29 +53,3 @@ export const createCompromiso = async (compromisoData: any, selectFile: any) =>
throw new Error('Network error: ' + error);
}
};

export const loadPDF = async (id :string,file: File) => {
try {
const token = Cookies.get('access_token');

const formData = new FormData();
formData.append('archivo_pdf', file);

const response = await fetch(`${URL}/pagos/compromisos/${id}/`, {
method: 'PATCH',
headers: {
Authorization: `Bearer ${token}`,
},
body: formData,
});

if (response.ok) {
const data = await response.json();
return data;
} else {
throw new Error('Error en la respuesta del servidor');
}
} catch (error) {
throw new Error('Network error: ' + error);
}
}
Loading

0 comments on commit b56cb2b

Please sign in to comment.