diff --git a/api/src/operations/item-create/index.ts b/api/src/operations/item-create/index.ts index c251551ff7..db9bf178ec 100644 --- a/api/src/operations/item-create/index.ts +++ b/api/src/operations/item-create/index.ts @@ -42,7 +42,7 @@ export default defineOperationApi({ if (!payloadObject) { result = null; } else { - result = await itemsService.createMany(toArray(payloadObject), { emitEvents }); + result = await itemsService.createMany(toArray(payloadObject), { emitEvents: !!emitEvents }); } return result; diff --git a/api/src/operations/item-delete/index.ts b/api/src/operations/item-delete/index.ts index 69aaf9b100..6a56e50b17 100644 --- a/api/src/operations/item-delete/index.ts +++ b/api/src/operations/item-delete/index.ts @@ -47,9 +47,9 @@ export default defineOperationApi({ const keys = toArray(key); if (keys.length === 1) { - result = await itemsService.deleteOne(keys[0], { emitEvents }); + result = await itemsService.deleteOne(keys[0], { emitEvents: !!emitEvents }); } else { - result = await itemsService.deleteMany(keys, { emitEvents }); + result = await itemsService.deleteMany(keys, { emitEvents: !!emitEvents }); } } diff --git a/api/src/operations/item-read/index.ts b/api/src/operations/item-read/index.ts index d133c3f388..ed836d1e17 100644 --- a/api/src/operations/item-read/index.ts +++ b/api/src/operations/item-read/index.ts @@ -48,9 +48,9 @@ export default defineOperationApi({ const keys = toArray(key); if (keys.length === 1) { - result = await itemsService.readOne(keys[0], sanitizedQueryObject, { emitEvents }); + result = await itemsService.readOne(keys[0], sanitizedQueryObject, { emitEvents: !!emitEvents }); } else { - result = await itemsService.readMany(keys, sanitizedQueryObject, { emitEvents }); + result = await itemsService.readMany(keys, sanitizedQueryObject, { emitEvents: !!emitEvents }); } } diff --git a/api/src/operations/item-update/index.ts b/api/src/operations/item-update/index.ts index b6e00739b1..e25ba21939 100644 --- a/api/src/operations/item-update/index.ts +++ b/api/src/operations/item-update/index.ts @@ -53,14 +53,14 @@ export default defineOperationApi({ let result: PrimaryKey | PrimaryKey[] | null; if (!key || (Array.isArray(key) && key.length === 0)) { - result = await itemsService.updateByQuery(sanitizedQueryObject, payloadObject, { emitEvents }); + result = await itemsService.updateByQuery(sanitizedQueryObject, payloadObject, { emitEvents: !!emitEvents }); } else { const keys = toArray(key); if (keys.length === 1) { - result = await itemsService.updateOne(keys[0], payloadObject, { emitEvents }); + result = await itemsService.updateOne(keys[0], payloadObject, { emitEvents: !!emitEvents }); } else { - result = await itemsService.updateMany(keys, payloadObject, { emitEvents }); + result = await itemsService.updateMany(keys, payloadObject, { emitEvents: !!emitEvents }); } }