diff --git a/lib/api/controllers/collections/collectionId/updateCollectionById.ts b/lib/api/controllers/collections/collectionId/updateCollectionById.ts index e300662..ca9b789 100644 --- a/lib/api/controllers/collections/collectionId/updateCollectionById.ts +++ b/lib/api/controllers/collections/collectionId/updateCollectionById.ts @@ -51,17 +51,18 @@ export default async function updateCollection( where: { id: collectionId, }, - data: { name: data.name.trim(), description: data.description, color: data.color, isPublic: data.isPublic, - parent: { - connect: { - id: data.parentId || undefined, - }, - }, + parent: data.parentId + ? { + connect: { + id: data.parentId, + }, + } + : undefined, members: { create: data.members.map((e) => ({ user: { connect: { id: e.user.id || e.userId } },