DELETE api city {city_uuid} - raianul/gridscale GitHub Wiki
Delete City
Deletes a specific city by its unique identifier.
Request
curl -X DELETE "http://127.0.0.1:1337/api/city/57734906-5f0b-48bb-9126-2ad63f2a86ee" -H "accept: application/json"
Response
{
"message": "City deleted successfully"
}
Note
The delete operation also remove the align cities for other city.
For Example:
Before
[
{
"city_uuid": "ecdac410-7861-4048-aaef-5dc3aa4be838",
"name": "Dhaka",
"geo_location_latitude": 80,
"geo_location_longitude": 100,
"beauty": "ugly",
"population": 3000,
"allied_cities": [
"57734906-5f0b-48bb-9126-2ad63f2a86ee"
]
},
{
"city_uuid": "219a7c33-03df-4b80-b282-d27534bb177c",
"name": "Berlin",
"geo_location_latitude": 52.52,
"geo_location_longitude": 13.4,
"beauty": "ugly",
"population": 3200000,
"allied_cities": []
},
{
"city_uuid": "57734906-5f0b-48bb-9126-2ad63f2a86ee",
"name": "Sylhet",
"geo_location_latitude": -70,
"geo_location_longitude": 100,
"beauty": "ugly",
"population": 1200,
"allied_cities": [
"ecdac410-7861-4048-aaef-5dc3aa4be838"
]
}
]
After Delete 57734906-5f0b-48bb-9126-2ad63f2a86ee
[
{
"city_uuid": "219a7c33-03df-4b80-b282-d27534bb177c",
"name": "Berlin",
"geo_location_latitude": 52.52,
"geo_location_longitude": 13.4,
"beauty": "ugly",
"population": 3200000,
"allied_cities": []
},
{
"city_uuid": "ecdac410-7861-4048-aaef-5dc3aa4be838",
"name": "Dhaka",
"geo_location_latitude": 80,
"geo_location_longitude": 100,
"beauty": "ugly",
"population": 3000,
"allied_cities": []
}
]