Skip to content

Commit b1f648a

Browse files
committed
fix(grpc): Mongoose FileCTR.create needs an array when using transactions
1 parent a950197 commit b1f648a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/services/grpc/boss/v2/upload-file-ctr.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export async function uploadFileCTR(request: UploadFileCTRRequest, context: Call
8282
await file.save({ session });
8383
}
8484

85-
file = await FileCTR.create({
85+
[file] = await FileCTR.create([{
8686
creator_pid: context.user?.pid,
8787
// * hash: String,
8888
// * file_key: String,
@@ -105,7 +105,7 @@ export async function uploadFileCTR(request: UploadFileCTRRequest, context: Call
105105
},
106106
created: Date.now(),
107107
updated: Date.now()
108-
});
108+
}], { session });
109109

110110
const cryptoOptions = payloads.map(payload => ({
111111
program_id: payload.titleId,

0 commit comments

Comments
 (0)