rubber-blueR
Refineβ€’3y agoβ€’
31 replies
rubber-blue

Errors When Trying to Delete a Resource

Ok, so in my List view, I added column actions for each row, where one of the actions is to delete that row.

I have my custom dataProvider setup with a deleteOne that takes in the parameters and sends out an API request to delete the request item.

I have also enabled canDelete in my App

For some reason though, when i click the delete action, I get the following errors in my console and deleteOne is never called:
TypeError: Cannot read properties of undefined (reading 'filter')
    at useDelete.ts:296:56
    at functionalUpdate (utils.ts:82:8)
    at QueryClient.setQueryData (queryClient.ts:218:18)
    at queryClient.ts:253:16
    at Array.map (<anonymous>)
    at queryClient.ts:251:10
    at Object.batch (notifyManager.ts:27:16)
    at QueryClient.setQueriesData (queryClient.ts:248:26)
    at Object.onMutate (useDelete.ts:290:33)
    at async Mutation.execute (mutation.ts:207:25)


and
TypeError: Cannot read properties of undefined (reading 'status')
    at Object.onError [as mutationFn] (authProvider.ts:77:24)
    at Object.fn (mutation.ts:179:31)
    at run (retryer.ts:147:31)
    at createRetryer (retryer.ts:204:5)
    at executeMutation (mutation.ts:174:22)
    at Mutation.execute (mutation.ts:216:26)
Was this page helpful?