feat: implement equipment and container loading rollback functionality with corresponding backend cloud functions

This commit is contained in:
ElPoyo
2026-05-27 22:04:46 +02:00
parent 64a9fe382a
commit faff06e4df
15 changed files with 660 additions and 514 deletions
+9 -5
View File
@@ -10,10 +10,7 @@ const {getSmtpConfig, EMAIL_CONFIG} = require("./utils/emailConfig");
* Envoie un email d'alerte à un utilisateur
* Appelé par le client Dart via callable function
*/
exports.sendAlertEmail = onCall({
region: "europe-west9",
cors: true,
}, async (request) => {
const handler = async (request) => {
// Vérifier l'authentification
if (!request.auth) {
throw new Error("L'utilisateur doit être authentifié");
@@ -75,7 +72,7 @@ exports.sendAlertEmail = onCall({
);
// Configurer le transporteur SMTP
const transporter = nodemailer.createTransporter(getSmtpConfig());
const transporter = nodemailer.createTransport(getSmtpConfig());
// Envoyer l'email
const info = await transporter.sendMail({
@@ -263,3 +260,10 @@ async function renderTemplate(templateName, data) {
}
}
exports.sendAlertEmail = onCall({
region: "europe-west9",
cors: true,
}, handler);
exports.handler = handler;