max future days
parent
0238e22393
commit
35817e0084
|
@ -6,6 +6,7 @@ import User from "../models/user";
|
|||
import UserGoogleTokens from "../models/userGoogleTokens";
|
||||
import axios from "axios";
|
||||
import { isPasswordValid } from "../validator/validator";
|
||||
import { requestTerminPlanerChangeFutureBookingDays } from "../utils/terminPlaner";
|
||||
|
||||
// this request is needed to get the store id after the user has connected his calendar to redirect him back to the calendar page
|
||||
export async function GetStoreId(req: Request, res: Response) {
|
||||
|
@ -233,6 +234,8 @@ export async function UpdateStoreCalendarSettings(req: Request, res: Response) {
|
|||
...update,
|
||||
calendar_min_earliest_booking_time: calendarMinEarliestBookingTime,
|
||||
};
|
||||
|
||||
requestTerminPlanerChangeFutureBookingDays(store.store_id);
|
||||
}
|
||||
|
||||
if (Object.keys(update).length === 0) {
|
||||
|
|
|
@ -20,6 +20,7 @@ import {
|
|||
USER_ANALYTICS_ENABLED_DEFAULT,
|
||||
} from "../utils/constants";
|
||||
import Store from "../models/store";
|
||||
import { requestTerminPlanerChangeFutureBookingDays } from "../utils/terminPlaner";
|
||||
|
||||
export async function AddEmployee(req: Request, res: Response) {
|
||||
try {
|
||||
|
@ -319,6 +320,8 @@ export async function UpdateEmployee(req: Request, res: Response) {
|
|||
...update,
|
||||
calendar_min_earliest_booking_time: calendarMinEarliestBookingTime,
|
||||
};
|
||||
|
||||
requestTerminPlanerChangeFutureBookingDays(store.store_id);
|
||||
}
|
||||
|
||||
if (Object.keys(update).length === 0) {
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
import axios from "axios";
|
||||
import logger from "../logger/logger";
|
||||
|
||||
export function requestTerminPlanerChangeFutureBookingDays(storeId: string) {
|
||||
axios
|
||||
.post(
|
||||
`${process.env.TERMIN_PLANNER_URL}/changeFutureBookingDays` as string,
|
||||
{
|
||||
storeId: storeId,
|
||||
pass: process.env.TERMIN_PLANNER_AUTHORIZATION_PASSWORD as string,
|
||||
}
|
||||
)
|
||||
.then((res) => {
|
||||
logger.info("req planner max future booking days %s", res.data);
|
||||
})
|
||||
.catch((err) => {
|
||||
logger.info("req planner max future booking days err %s", err);
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue