I'm trying to integrate admin-on-rest with an api sending a 204 HTTP response without a body on successful DELETE.
So on DELETE I get the error message :
REST response must contain a data key
I'm using jsonServerRestClient and I wonder how could I override this client so it accepts 204 on DELETE and redirects to the list ?
so, if my trivial answer was converted to comment write it more detail.
you can write your own client. add this to App.js
import customRestClient from './customRestClient'
create customRestClient.js and put code from jsonServerRestClient.js
there in function convertHTTPResponseToREST
you can add
console.log(response);
console.log(type);
console.log(resource);
console.log(params);
and see that response is object that contains code of response.
In case block you can write your own behavior by adding DELETE.
I hope, that it will help you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With