Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Server communication error" even if delete request was successful #440

Closed
anjeylink opened this issue Mar 24, 2022 · 3 comments
Closed

Comments

@anjeylink
Copy link
Contributor

Admin version: 2.8.3

Description
I get "Server communication error" every time I delete a record.

Possible solution
All delete requests done by dataProvider.delete() got rejected by fetchJsonLd because of changes done in this commit

@gartner
Copy link

gartner commented Apr 9, 2022

I see the same behavior in Admin 3.0.0-rc

@theMadness
Copy link

theMadness commented Apr 13, 2022

My current workaround is to decorate the dataProvider

return {
  ...dataProvider,
  // @ts-ignore
  delete: (
    resource: string,
    params: ApiPlatformAdminDeleteParams,
  ): Promise<DeleteResult<ApiPlatformAdminRecord>> =>
    dataProvider.delete(resource, params).then(
      result => result,
      error => {
        return error.response.status === 204
          ? { data: params.previousData }
          : Promise.reject(error);
      },
    ),
};

(also accepting suggestions on how to get rid of the typescript issues that force me to use @ts-ignore. :P

@alanpoulain
Copy link
Member

It should be solved in 2.8.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants