packages start...

This commit is contained in:
2023-06-03 18:07:58 +00:00
parent 3dcd4dd093
commit de71e679ec
21 changed files with 686 additions and 48 deletions

View File

@@ -0,0 +1,18 @@
;(function () {
const request = context.request()
//get id of deleted image entry (delete request URL is : .../api/_/demo/medialib/id)
const id = request.param("id")
//find all entrys where there is an image field with the id of this deleted one (image is an foreignKey widget, so stores the id as a string internally)
const referencingElements = context.db.find("democol", {
filter: {
image: id,
},
})
referencingElements.forEach((e) => {
//update all those entries to remove the image id from them, since its deleted...
context.db.update("democol", e.id, {
image: "",
})
})
})()