react-admin-import-csv icon indicating copy to clipboard operation
react-admin-import-csv copied to clipboard

Colliding ids for disableGetMany option

Open KonkretneKosteczki opened this issue 2 years ago • 2 comments

I've been trying to use the module with react-admin-firebase, however react-admin-firbease does return objects for the getMany calls (with just ids) even if those do not exist, which forced me to use the getOne instead.

However, It seems that when resource is successfully obtained via getOne the id is marked as non colliding, and when there is an error when querying the resource it is marked as colliding, which is the exact opposite of how it should work.

https://github.com/benwinding/react-admin-import-csv/blob/d85b21256c7e7d0f71307e7e686ee796c907a4f6/src/import-controller.ts#L65-L67

Simply replacing the return value of then with return value of catch and vice verse should fix the issue.

KonkretneKosteczki avatar Aug 01 '22 12:08 KonkretneKosteczki

Is this repository dead? this doesn't seem like that much of an issue to fix this bug. Why should a function return the id if the app did find an object with the same id, and not return it otherwise.

KonkretneKosteczki avatar Sep 02 '22 09:09 KonkretneKosteczki

Is this repository dead? this doesn't seem like that much of an issue to fix this bug.

I'm very busy at the moment, feel free to contribute a PR if it's an easy bug to fix 👍

benwinding avatar Sep 05 '22 00:09 benwinding