Initial commit

This commit is contained in:
2023-12-26 20:24:42 +01:00
commit 66d0377a00
657 changed files with 21841 additions and 0 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: "",
})
})
})()