rm debug
parent
c3a34d09fd
commit
1dac4d4dbd
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue