refactoring

This commit is contained in:
Emily
2025-03-03 19:31:35 +01:00
parent 76e5e07f79
commit 63fa3995c5
70 changed files with 2928 additions and 418 deletions

View File

@@ -38,6 +38,36 @@ app.use((req, res, next) => {
next();
});
app.post('/send/invite', express.json(), async (req, res) => {
try {
const { target, projectName, link } = req.body;
const ok = await EmailService.sendInviteEmail(target, projectName, link);
res.json({ ok });
} catch (ex) {
res.status(500).json({ error: ex.message });
}
});
app.post('/send/invite/noaccount', express.json(), async (req, res) => {
try {
const { target, projectName, link } = req.body;
const ok = await EmailService.sendInviteEmailNoAccount(target, projectName, link);
res.json({ ok });
} catch (ex) {
res.status(500).json({ error: ex.message });
}
});
app.post('/brevolist/add', express.json(), async (req, res) => {
try {
const { email } = req.body;
const ok = await EmailService.createContact(email);
res.json({ ok });
} catch (ex) {
res.status(500).json({ error: ex.message });
}
});
app.post('/send/confirm', express.json(), async (req, res) => {
try {
const { target, link } = req.body;