function onActionBegin(args) { if (args.requestType === 'eventCreate') {
// You can create appointments based on keycloak authentication using args data. If you want to prevent the appointment creation, pass args.cancel as 'true'. If you want create the appointment, pass args.cancel as 'false'.
}
if (
args.requestType === 'eventCreate' ||
args.requestType === 'eventChange'
) {
let data = args.data instanceof Array ? args.data[0] : args.data;
args.cancel = !scheduleObj.isSlotAvailable(data);
}
}