Fixes custom-inputs clearing on save (#890)

pull/888/head^2
Alex van Andel 2021-10-09 15:48:26 +01:00 committed by GitHub
parent f03a2c2a1a
commit 014b74be8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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)