File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ import Toast from "../toast/toast.astro";
6767 fetch(backend_url + "api/report/new-report", {
6868 method: "POST",
6969 body: JSON.stringify(report),
70+ headers: { "Content-Type": "application/json" },
7071 })
7172 .then((response) => {
7273 const alert = `Reporte enviado satisfactoriamente. Gracias por contactarnos.`;
Original file line number Diff line number Diff line change @@ -149,7 +149,9 @@ for (const key in categories) {
149149 return;
150150 }
151151 try {
152- const response = await fetch(`${backend_url}api/jobs/get-job?id=${jobId}`);
152+ const response = await fetch(`${backend_url}api/jobs/get-job?id=${jobId}`, {
153+ headers: { "Content-Type": "application/json" },
154+ });
153155 if (!response.ok) throw new Error("Failed to load job");
154156 const data = await response.json();
155157 populateForm(data);
@@ -226,7 +228,10 @@ for (const key in categories) {
226228 if (!confirm("¿Estás seguro de que quieres eliminar este empleo? Esta acción no se puede deshacer.")) return;
227229
228230 try {
229- const response = await fetch(`${backend_url}api/jobs/delete-job?id=${jobId}`, { method: "DELETE" });
231+ const response = await fetch(`${backend_url}api/jobs/delete-job?id=${jobId}`, {
232+ method: "DELETE",
233+ headers: { "Content-Type": "application/json" },
234+ });
230235 if (!response.ok) throw new Error("Delete failed");
231236 window.open(`${window.location.origin}/empleo-eliminado`, "_self");
232237 } catch (e) {
Original file line number Diff line number Diff line change @@ -176,6 +176,7 @@ import Toast from "../components/toast/toast.astro";
176176 fetch(backend_url + "api/members/create-invitation", {
177177 method: "POST",
178178 body: JSON.stringify({ email: email }),
179+ headers: { "Content-Type": "application/json" },
179180 })
180181 .then((response) => response.json())
181182 .then((data) => {
You can’t perform that action at this time.
0 commit comments