Skip to content

Commit 7c3f4a1

Browse files
committed
fix projectuser sync: Argument project is missing
1 parent 2e5e8aa commit 7c3f4a1

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/services.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,19 @@ export class DatabaseService {
246246
project_id: projectUser.project_id
247247
}
248248
},
249-
update: projectUser,
250-
create: projectUser
249+
// Only update scalar fields here; do not pass relation objects directly
250+
update: {
251+
status: projectUser.status,
252+
updated_at: projectUser.updated_at,
253+
},
254+
// For creation, explicitly connect required relations instead of passing relation objects
255+
create: {
256+
status: projectUser.status,
257+
created_at: projectUser.created_at,
258+
updated_at: projectUser.updated_at,
259+
project: { connect: { id: projectUser.project_id } },
260+
user: { connect: { id: projectUser.user_id } }
261+
}
251262
})
252263
);
253264
await prisma.$transaction(insert);

0 commit comments

Comments
 (0)