For example I have this POST
method:
request_salaries(type)
type
can be red
, blue
or green
.
The function returns this object:
{
data: [
{
id: 1,
name: "Linda",
type: "Red"
},
{
id: 2,
name: "Mark",
type: "Green
},
{
id: 3,
name: "Susan",
type: "Blue"
}
]
}
Now, I need to return only the sat of data that is passed in the request_salaries(type)
.
For example, if I request request_salaries(
Red)
it should return:
{
data: [
{
id: 1,
name: "Linda",
type: "Red"
},
]
}
How can this be achievable?
Thanks.