feat: podpora více odkazů na podnik při objednávání

This commit is contained in:
2026-08-25 11:28:57 +02:00
parent 93242b7c7e
commit ce051447e6
13 changed files with 338 additions and 81 deletions
+5 -2
View File
@@ -21,12 +21,15 @@ router.get("/dates", async (_req, res, next) => {
router.post("/create", async (req: Request, res, next) => {
const login = getLogin(parseToken(req));
const { name } = req.body ?? {};
const { name, url } = req.body ?? {};
if (!name || typeof name !== 'string') {
return res.status(400).json({ error: 'Nebyl předán název skupiny' });
}
if (url != null && typeof url !== 'string') {
return res.status(400).json({ error: 'Neplatná URL nabídky' });
}
try {
const data = await createGroup(login, name);
const data = await createGroup(login, name, undefined, url);
broadcastExtra(data);
res.status(200).json(data);
} catch (e: any) { next(e); }