My json structure simulates a folder setup as follows:
{
"boxId": "45345344535",
"modifiedDate": "2023-08-18T11:07:43-04:00",
"name": "FolderTest",
"size": 7751630,
"files": [
{
"boxId": "2343214243",
"modifiedDate": null,
"name": "Original Preprint Submission.pdf",
"size": null
},
{
"boxId": "43534534543534",
"modifiedDate": null,
"name": "Original Supporting docs.msg",
"size": null
}
],
"folders": [
{
"boxId": "34534534534535",
"modifiedDate": "2023-08-18T11:07:02-04:00",
"name": "Round 1",
"size": 4092614,
"files": [
{
"boxId": "45325252435235",
"modifiedDate": null,
"name": "Round 1 Preprint.pdf",
"size": null
},
{
"boxId": "45436567546754",
"modifiedDate": null,
"name": "Round 1 response.pdf",
"size": null
},
{
"boxId": "324243245435345",
"modifiedDate": null,
"name": "Round 1 supporting doc 1.pdf",
"size": null
},
{
"boxId": "3421342142142134",
"modifiedDate": null,
"name": "Round 1 supporting doc 2.docx",
"size": null
}
],
"folders": []
}
]
}
I am attempting to devise a recursive function that can identify and remove a specific file node based on its id within the original array. I have come across a relevant discussion at this link, but adapting it to my json structure is proving challenging.