diff --git a/api/src/operations/item-delete/index.ts b/api/src/operations/item-delete/index.ts index 2354239e0a..55460d594d 100644 --- a/api/src/operations/item-delete/index.ts +++ b/api/src/operations/item-delete/index.ts @@ -42,7 +42,7 @@ export default defineOperationApi({ let result: PrimaryKey | PrimaryKey[] | null; - if (!key) { + if (!key || (Array.isArray(key) && key.length === 0)) { result = await itemsService.deleteByQuery(sanitizedQueryObject); } else { const keys = toArray(key); diff --git a/api/src/operations/item-read/index.ts b/api/src/operations/item-read/index.ts index 3ce20c2f01..3313d22c17 100644 --- a/api/src/operations/item-read/index.ts +++ b/api/src/operations/item-read/index.ts @@ -42,7 +42,7 @@ export default defineOperationApi({ let result: Item | Item[] | null; - if (!key) { + if (!key || (Array.isArray(key) && key.length === 0)) { result = await itemsService.readByQuery(sanitizedQueryObject); } else { const keys = toArray(key); diff --git a/api/src/operations/item-update/index.ts b/api/src/operations/item-update/index.ts index 6de5fbadef..e77ceb6ca1 100644 --- a/api/src/operations/item-update/index.ts +++ b/api/src/operations/item-update/index.ts @@ -53,7 +53,7 @@ export default defineOperationApi({ let result: PrimaryKey | PrimaryKey[] | null; - if (!key) { + if (!key || (Array.isArray(key) && key.length === 0)) { result = await itemsService.updateByQuery(sanitizedQueryObject, payloadObject, { emitEvents }); } else { const keys = toArray(key); diff --git a/app/src/operations/item-delete/index.ts b/app/src/operations/item-delete/index.ts index 4dc5454cc3..5aecc1382d 100644 --- a/app/src/operations/item-delete/index.ts +++ b/app/src/operations/item-delete/index.ts @@ -14,7 +14,7 @@ export default defineOperationApp({ }, { label: '$t:operations.item-delete.key', - text: key ? toArray(key).join(', ') : '--', + text: toArray(key).length > 0 ? toArray(key).join(', ') : '--', }, ]; diff --git a/app/src/operations/item-read/index.ts b/app/src/operations/item-read/index.ts index 100e0aa8fe..d3e3cc21e8 100644 --- a/app/src/operations/item-read/index.ts +++ b/app/src/operations/item-read/index.ts @@ -14,7 +14,7 @@ export default defineOperationApp({ }, { label: '$t:operations.item-read.key', - text: key ? toArray(key).join(', ') : '--', + text: toArray(key).length > 0 ? toArray(key).join(', ') : '--', }, ]; diff --git a/app/src/operations/item-update/index.ts b/app/src/operations/item-update/index.ts index c3056ddfe3..6e1dacc93b 100644 --- a/app/src/operations/item-update/index.ts +++ b/app/src/operations/item-update/index.ts @@ -13,7 +13,7 @@ export default defineOperationApp({ }, { label: '$t:operations.item-update.key', - text: key ? toArray(key).join(', ') : '--', + text: toArray(key).length > 0 ? toArray(key).join(', ') : '--', }, ];