I am trying to make update/PATCH request using Jsonapi: https://jsonapi.org/format/
<code>export const update = (type: string, id: string, body: object = {}, query: object = {}) => {
const bodyTemp = { data: { id, type, ...body } };
return jsonApi.update(type, bodyTemp, query);
};
</code>
<code>export const update = (type: string, id: string, body: object = {}, query: object = {}) => {
const bodyTemp = { data: { id, type, ...body } };
return jsonApi.update(type, bodyTemp, query);
};
</code>
export const update = (type: string, id: string, body: object = {}, query: object = {}) => {
const bodyTemp = { data: { id, type, ...body } };
return jsonApi.update(type, bodyTemp, query);
};
The error in this code is, it is not getting the id probably because jsonApi has a setup that I couldnt figure out what.
the url is getting like this: http://localhost/api/url instead it should be like this http://localhost/api/url/${id}
How can I fix it?