Lets say i have a village, inside the village are houses, inside the house are citizens.
so a village hasmany > house hasmany > citizen.
When I delete a village in my JSON server, the related houses are correctly deleted, but the citizens related to those houses are for some reason not deleted. This results in incomplete data deletion, which can lead to inconsistency and errors in the data.
Steps to reproduce:
Delete a village that has houses that also have citizens in it by using the DELETE method in the API.
Expected result: The village, related houses, and citizens should be deleted by just making a delete request for the village.
Actual result: The village and rhouses are deleted, but the citizens are not deleted and now homeless on a empty field.
what my db.json looks like:
`{
"villages": [
{
"id": 1,
"name": "example name"
}
],
"houses": [
{
"id": 1,
"villageId": 1,
"name": "example"
}
],
"citizens": [
{
"id": 1,
"houseId": 1,
"name": "example"
}
]
}`
Lets say i have a village, inside the village are houses, inside the house are citizens.
so a village hasmany > house hasmany > citizen.
When I delete a village in my JSON server, the related houses are correctly deleted, but the citizens related to those houses are for some reason not deleted. This results in incomplete data deletion, which can lead to inconsistency and errors in the data.
Steps to reproduce:
Delete a village that has houses that also have citizens in it by using the DELETE method in the API.
Expected result: The village, related houses, and citizens should be deleted by just making a delete request for the village.
Actual result: The village and rhouses are deleted, but the citizens are not deleted and now homeless on a empty field.
what my db.json looks like:
`{
"villages": [
{
"id": 1,
"name": "example name"
}
],
"houses": [
{
"id": 1,
"villageId": 1,
"name": "example"
}
],
"citizens": [
{
"id": 1,
"houseId": 1,
"name": "example"
}
]
}`