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) {
|
if (!req.body?.login) {
|
||||||
throw Error("Nebyl předán login uživatele");
|
throw Error("Nebyl předán login uživatele");
|
||||||
}
|
}
|
||||||
deletePizzaDay(req.body.login);
|
const data = deletePizzaDay(req.body.login);
|
||||||
io.emit("message", getData());
|
io.emit("message", data);
|
||||||
});
|
});
|
||||||
|
|
||||||
app.post("/api/addPizza", (req, res) => {
|
app.post("/api/addPizza", (req, res) => {
|
||||||
|
@ -51,7 +51,9 @@ export function deletePizzaDay(login: string) {
|
|||||||
if (clientData.pizzaDay.creator !== login) {
|
if (clientData.pizzaDay.creator !== login) {
|
||||||
throw Error("Login uživatele se neshoduje se zakladatelem Pizza Day");
|
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