fix update collection bug

This commit is contained in:
daniel31x13 2024-02-08 08:25:45 -05:00
parent 7d9cc1f1f0
commit f7a53d53e2

View File

@ -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: {
parent: data.parentId
? {
connect: {
id: data.parentId || undefined,
},
id: data.parentId,
},
}
: undefined,
members: {
create: data.members.map((e) => ({
user: { connect: { id: e.user.id || e.userId } },