main
alex 2024-01-21 21:05:01 +01:00
parent c3a34d09fd
commit 1dac4d4dbd
1 changed files with 3 additions and 26 deletions

View File

@ -113,19 +113,7 @@ export async function AddEmployee(req: Request, res: Response) {
calendar_max_future_booking_days: calendarMaxFutureBookingDays,
calendar_min_earliest_booking_time: calendarMinEarliestBookingTime,
})
.then(() => {
// add user to termin planner
axios
.post(`${process.env.TERMIN_PLANNER_URL}/addUser` as string, {
userId: userId,
pass: process.env.TERMIN_PLANNER_AUTHORIZATION_PASSWORD as string,
})
.catch((err) => {
logger.info("err %s", err);
});
res.status(200).send({ msg: "success" });
})
.then(() => res.status(200).send({ msg: "success" }))
.catch((err) => {
logger.error(err);
res.status(500).send({ err: "invalid request" });
@ -366,24 +354,13 @@ export async function DeleteEmployee(req: Request, res: Response) {
return res.status(400).send({ err: "invalid request" });
}
// delete user
await User.destroy({
User.destroy({
where: {
user_id: userId,
},
})
.then(() => {
// remove user from termin planner
axios
.post(`${process.env.TERMIN_PLANNER_URL}/removeUser` as string, {
userId: userId,
pass: process.env.TERMIN_PLANNER_AUTHORIZATION_PASSWORD as string,
})
.catch((err) => {
logger.info("err %s", err);
});
// delete user
res.status(200).send({ msg: "success" });
})
.catch((err) => {