Merge branch 'main' of https://gitea.carpa.com/LGCC/cdrdpyj
This commit is contained in:
commit
f43ce6654c
|
|
@ -24,3 +24,4 @@ pnpm-debug.log*
|
||||||
|
|
||||||
/generated/prisma
|
/generated/prisma
|
||||||
/prisma/*.db
|
/prisma/*.db
|
||||||
|
prisma/dev.db
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,31 @@ export const POST: APIRoute = async ({ request }) => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
const emailApiKey = import.meta.env.EMAIL_API_KEY;
|
||||||
|
|
||||||
|
const emailResponse = await fetch("http://155.138.215.11:3050/email/send", {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"x-api-key": emailApiKey!,
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
type: "CENTRO_DEL_REINO_PAZ_Y_JUSTICIA_INFO",
|
||||||
|
data: {
|
||||||
|
nombre,
|
||||||
|
email,
|
||||||
|
mensaje,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!emailResponse.ok) {
|
||||||
|
console.error("Error enviando correo");
|
||||||
|
return new Response(
|
||||||
|
JSON.stringify({ error: "Error en servicio de correo" }),
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return new Response(null, {
|
return new Response(null, {
|
||||||
status: 302,
|
status: 302,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue