updateEmployee: function(id: string, employee: json): json js server
I am working on an POST API call. I need the ‘id’ as a path variable and ‘employee’ as a request body. I am able to read ‘employee’ json object in the function when it is a POST call but ‘id’ shows up as null. I am able to read ‘id’ string in the function when it is a PUT call but ‘employee’ shows up as null.
If I can include ‘id’ field in the request body, I am able to get the ‘id’. I am working on how to get the ‘id’ from path variable.
I am using postman to make these calls, and also included Content-Type = “application/json”.
Any thoughts on how to solve this issue? Please let me know. Thank you.