diff --git a/pages/api/availability/eventtype.ts b/pages/api/availability/eventtype.ts index afa8588f..188b04b6 100644 --- a/pages/api/availability/eventtype.ts +++ b/pages/api/availability/eventtype.ts @@ -5,7 +5,7 @@ import { getSession } from "@lib/auth"; import prisma from "@lib/prisma"; function handleCustomInputs(customInputs: EventTypeCustomInput[], eventTypeId: number) { - if (!customInputs || customInputs?.length) return undefined; + if (!customInputs || !customInputs?.length) return undefined; const cInputsIdsToDelete = customInputs.filter((input) => input.id > 0).map((e) => e.id); const cInputsToCreate = customInputs .filter((input) => input.id < 0)