File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments