Feedback from zomars
parent
f45be560cb
commit
543b25f7df
|
@ -73,16 +73,18 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps,
|
|||
|
||||
const toggleGuests = (enabled: boolean) => {
|
||||
const bookingFields = formMethods.getValues("bookingFields");
|
||||
const newBookingFieldsWithGuestsDisabled = bookingFields.map((field) => {
|
||||
if (field.name === "guests") {
|
||||
return {
|
||||
...field,
|
||||
hidden: !enabled,
|
||||
};
|
||||
}
|
||||
return field;
|
||||
});
|
||||
formMethods.setValue("bookingFields", newBookingFieldsWithGuestsDisabled);
|
||||
formMethods.setValue(
|
||||
"bookingFields",
|
||||
bookingFields.map((field) => {
|
||||
if (field.name === "guests") {
|
||||
return {
|
||||
...field,
|
||||
hidden: !enabled,
|
||||
};
|
||||
}
|
||||
return field;
|
||||
})
|
||||
);
|
||||
};
|
||||
return (
|
||||
<div className="flex flex-col space-y-8">
|
||||
|
|
|
@ -8,7 +8,9 @@ async function handler(req: NextApiRequest & { userId?: number }) {
|
|||
const session = await getSession({ req });
|
||||
/* To mimic API behavior and comply with types */
|
||||
req.userId = session?.user?.id || -1;
|
||||
const booking = await handleNewBooking(req, true);
|
||||
const booking = await handleNewBooking(req, {
|
||||
isNotAnApiCall: true,
|
||||
});
|
||||
return booking;
|
||||
}
|
||||
|
||||
|
|
|
@ -398,7 +398,14 @@ function getCustomInputsResponses(
|
|||
return customInputsResponses;
|
||||
}
|
||||
|
||||
async function handler(req: NextApiRequest & { userId?: number | undefined }, isNotAnApiCall = false) {
|
||||
async function handler(
|
||||
req: NextApiRequest & { userId?: number | undefined },
|
||||
{
|
||||
isNotAnApiCall = false,
|
||||
}: {
|
||||
isNotAnApiCall?: boolean;
|
||||
}
|
||||
) {
|
||||
const { userId } = req;
|
||||
|
||||
// handle dynamic user
|
||||
|
|
Loading…
Reference in New Issue