Nemazat všechna data při smazání pizza day
This commit is contained in:
parent
cdcd620ee5
commit
5e94009898
@ -62,8 +62,8 @@ app.post("/api/deletePizzaDay", (req, res) => {
|
||||
if (!req.body?.login) {
|
||||
throw Error("Nebyl předán login uživatele");
|
||||
}
|
||||
deletePizzaDay(req.body.login);
|
||||
io.emit("message", getData());
|
||||
const data = deletePizzaDay(req.body.login);
|
||||
io.emit("message", data);
|
||||
});
|
||||
|
||||
app.post("/api/addPizza", (req, res) => {
|
||||
|
@ -51,7 +51,9 @@ export function deletePizzaDay(login: string) {
|
||||
if (clientData.pizzaDay.creator !== login) {
|
||||
throw Error("Login uživatele se neshoduje se zakladatelem Pizza Day");
|
||||
}
|
||||
db.delete(today);
|
||||
delete clientData.pizzaDay;
|
||||
db.set(today, clientData);
|
||||
return clientData;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user