Serverová validace času odchodu
This commit is contained in:
@@ -293,7 +293,7 @@ app.post("/api/updatePizzaDayNote", async (req, res) => {
|
||||
res.status(200).json(data);
|
||||
});
|
||||
|
||||
app.post("/api/changeDepartureTime", async (req, res) => {
|
||||
app.post("/api/changeDepartureTime", async (req, res, next) => {
|
||||
const login = getLogin(parseToken(req));
|
||||
let date = undefined;
|
||||
if (req.body.dayIndex != null) {
|
||||
@@ -305,9 +305,11 @@ app.post("/api/changeDepartureTime", async (req, res) => {
|
||||
}
|
||||
date = getDateForWeekIndex(dayIndex);
|
||||
}
|
||||
const data = await updateDepartureTime(login, req.body?.time, date);
|
||||
io.emit("message", data);
|
||||
res.status(200).json(data);
|
||||
try {
|
||||
const data = await updateDepartureTime(login, req.body?.time, date);
|
||||
io.emit("message", data);
|
||||
res.status(200).json(data);
|
||||
} catch (e: any) { next(e) }
|
||||
});
|
||||
|
||||
// Middleware pro zpracování chyb
|
||||
|
||||
Reference in New Issue
Block a user