Fixes custom-inputs clearing on save (#890)
parent
f03a2c2a1a
commit
014b74be8c
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue