fix update collection bug
This commit is contained in:
parent
7d9cc1f1f0
commit
f7a53d53e2
|
@ -51,17 +51,18 @@ export default async function updateCollection(
|
||||||
where: {
|
where: {
|
||||||
id: collectionId,
|
id: collectionId,
|
||||||
},
|
},
|
||||||
|
|
||||||
data: {
|
data: {
|
||||||
name: data.name.trim(),
|
name: data.name.trim(),
|
||||||
description: data.description,
|
description: data.description,
|
||||||
color: data.color,
|
color: data.color,
|
||||||
isPublic: data.isPublic,
|
isPublic: data.isPublic,
|
||||||
parent: {
|
parent: data.parentId
|
||||||
connect: {
|
? {
|
||||||
id: data.parentId || undefined,
|
connect: {
|
||||||
},
|
id: data.parentId,
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
members: {
|
members: {
|
||||||
create: data.members.map((e) => ({
|
create: data.members.map((e) => ({
|
||||||
user: { connect: { id: e.user.id || e.userId } },
|
user: { connect: { id: e.user.id || e.userId } },
|
||||||
|
|
Ŝarĝante…
Reference in New Issue