Squiz Matrix v5.3.4.0
I am in the process of setting up a document upload as part of a form submission but once this has been completed and the email sent I would like to completely delete the assets that were uploaded. These documents will contain sensitive data and can’t hang around the CMS for longer than they need to, so if possible removed from the trash as well.
I have followed the batching example on the manuals site but when it gets to the bit about supplying the asset ids to the trashAssets it errors out with:
Exception occurred when executing JS API function “trashAsset()”: Assertion failed: [NULL] “” is not a valid asset ID
This is the code I’m using:
js_api.batchRequest({
"functions":{
"0":{
"function":"getChildren",
"args":{
"asset_id": "1526929",
"levels": 1,
"get_attributes": 0
},
"blocking":1
},
"1":{
"function":"trashAsset",
"args":{
"asset_ids":["%results_0_0_id%","%results_0_1_id%"],
}
}
}
});
Where am I going wrong? Ideally, I would like to be able to supply an array of all the file ids found in the folder but I can’t work that bit out either.