I want to make a filter so that it only returns the data if they belong to a user but I can’t make the filter on the relationship.
What I want is to return only the addresses that belong to the user with ID 1.
These are the example data where user is the relation
{
"data": [
{
"id": 3,
"attributes": {
"title": "Casa",
"name": "Pepe",
"address": "Calle perez lome, 9",
"city": "Madrid",
"state": "Madrid",
"postal_code": "00000",
"phone": "111222333",
"createdAt": "2023-02-01T22:57:38.502Z",
"updatedAt": "2023-02-01T23:07:13.604Z",
"publishedAt": "2023-02-01T22:57:38.499Z",
"user": {
"data": {
"id": 1,
"attributes": {
"username": "pepe",
"email": "pepe@gmail.com",
"provider": "local",
"confirmed": true,
"blocked": false,
"createdAt": "2023-01-31T22:52:17.431Z",
"updatedAt": "2023-02-01T19:20:48.169Z",
"name": "Pepe"
}
}
}
}
},
{
"id": 6,
"attributes": {
"title": "aaaa",
"name": "aaa",
"address": "aaa",
"city": "aaa",
"state": "aaa",
"postal_code": "aaa",
"phone": "111222333",
"createdAt": "2023-02-01T23:03:00.684Z",
"updatedAt": "2023-02-01T23:03:01.829Z",
"publishedAt": "2023-02-01T23:03:01.827Z",
"user": {
"data": {
"id": 2,
"attributes": {
"username": "carlos_gammer",
"email": "carlos@tincode.es",
"provider": "local",
"confirmed": true,
"blocked": false,
"createdAt": "2023-01-31T22:53:41.683Z",
"updatedAt": "2023-01-31T22:53:41.683Z",
"name": "Carlos"
}
}
}
}
}
],
}