fix(grpc): Mongoose FileCTR.create needs an array when using transactions

This commit is contained in:
Jonathan Barrow 2025-12-02 11:54:17 -05:00
parent a95019778c
commit b1f648a176
No known key found for this signature in database
GPG Key ID: 2A7DAA6DED5A77E5

View File

@ -82,7 +82,7 @@ export async function uploadFileCTR(request: UploadFileCTRRequest, context: Call
await file.save({ session });
}
file = await FileCTR.create({
[file] = await FileCTR.create([{
creator_pid: context.user?.pid,
// * hash: String,
// * file_key: String,
@ -105,7 +105,7 @@ export async function uploadFileCTR(request: UploadFileCTRRequest, context: Call
},
created: Date.now(),
updated: Date.now()
});
}], { session });
const cryptoOptions = payloads.map(payload => ({
program_id: payload.titleId,