I am currently attempting to send a GET request to json-server in order to retrieve data from a nested object. However, the response I am receiving is empty instead of containing the desired data key.
After thoroughly reviewing the documentation, I could not find any information specific to the structure of the database that I am using.
My intention is to filter the model array but unfortunately, I am unable to access the model data.
Here is an excerpt from my db.json file:
{
"data": {
"model":
[
{
"name": "BERLINGO",
"manufacturerName": "CITREON",
"id": 1
},
{
"name": "C3",
"manufacturerName": "CITREON",
"id": 2
}
]
}
}
When sending a GET request to /data, the response I receive is as follows:
{
"model": [
{
"name": "BERLINGO",
"manufacturerName": "CITREON",
"id": 1
},
{
"name": "C3",
"manufacturerName": "CITREON",
"id": 2
}
]
}
However, when making a GET call to /data/model, I am only receiving an empty object.
{}