From 7c1d3f9ca2635a47fdd22484c6f73fe250c03d8d Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 11 Feb 2024 10:32:22 +0100 Subject: [PATCH] update calendar settings --- src/controllers/calendarController.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/controllers/calendarController.ts b/src/controllers/calendarController.ts index b1c9bc1..3c1b370 100644 --- a/src/controllers/calendarController.ts +++ b/src/controllers/calendarController.ts @@ -195,6 +195,23 @@ export async function UpdatePersonalCalendarSettings( return res.status(401).send({ err: "unauthorized" }); } + // request to termin planner to update the settings + + const user = await User.findOne({ + where: { + user_id: userSession.user_id, + }, + attributes: ["store_id"], + }); + + if (!user) { + return res.status(401).send({ err: "unauthorized" }); + } + + terminPlanerRequest("/api/v1/changedSettings", "POST", { + storeId: user.store_id, + }); + // update user await User.update(