Skip to content

Commit 696b6f2

Browse files
bors[bot]bidoubiwa
andauthored
Merge #177
177: Fix delete hook when triggered with checkbox r=bidoubiwa a=bidoubiwa Co-authored-by: Charlotte Vermandel <[email protected]>
2 parents da01634 + deb6ae8 commit 696b6f2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

services/lifecycles.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ async function afterCreate(result, collection, httpClient) {
1717

1818
async function afterDelete(result, collection, httpClient) {
1919
try {
20+
const documentIds = Array.isArray(result)
21+
? result.map(doc => doc.id)
22+
: [result.id]
2023
await httpClient.deleteDocuments({
2124
indexUid: collection,
22-
documentIds: [result.id],
25+
documentIds,
2326
})
2427
} catch (e) {
2528
console.error(e)

0 commit comments

Comments
 (0)