fix prisma error on event-type update (#950)
* fix prisma error on event-type update * fix hidden event-type updatepull/952/head
parent
f4d2f3b3d1
commit
a711670a70
|
@ -132,7 +132,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||||
if (req.body.users) {
|
if (req.body.users) {
|
||||||
data.users = {
|
data.users = {
|
||||||
set: [],
|
set: [],
|
||||||
connect: req.body.users.map((id: number) => ({ id })),
|
connect: req.body.users.map((id: string) => ({ id: parseInt(id) })),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,6 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||||
advancedPayload.availability = enteredAvailability || undefined;
|
advancedPayload.availability = enteredAvailability || undefined;
|
||||||
advancedPayload.customInputs = customInputs;
|
advancedPayload.customInputs = customInputs;
|
||||||
advancedPayload.timeZone = selectedTimeZone;
|
advancedPayload.timeZone = selectedTimeZone;
|
||||||
advancedPayload.hidden = hidden;
|
|
||||||
advancedPayload.disableGuests = formData.disableGuests === "on";
|
advancedPayload.disableGuests = formData.disableGuests === "on";
|
||||||
advancedPayload.requiresConfirmation = formData.requiresConfirmation === "on";
|
advancedPayload.requiresConfirmation = formData.requiresConfirmation === "on";
|
||||||
}
|
}
|
||||||
|
@ -176,6 +175,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||||
slug: asStringOrThrow(formData.slug),
|
slug: asStringOrThrow(formData.slug),
|
||||||
description: asStringOrThrow(formData.description),
|
description: asStringOrThrow(formData.description),
|
||||||
length: asNumberOrThrow(formData.length),
|
length: asNumberOrThrow(formData.length),
|
||||||
|
hidden,
|
||||||
locations,
|
locations,
|
||||||
...advancedPayload,
|
...advancedPayload,
|
||||||
...(team
|
...(team
|
||||||
|
|
Loading…
Reference in New Issue