feat: podpora více odkazů na podnik při objednávání
This commit is contained in:
@@ -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); }
|
||||
|
||||
Reference in New Issue
Block a user