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

Colliding ids for disableGetMany option #90

Open
KonkretneKosteczki opened this issue Aug 1, 2022 · 2 comments
Open

Colliding ids for disableGetMany option #90

KonkretneKosteczki opened this issue Aug 1, 2022 · 2 comments

Comments

@KonkretneKosteczki
Copy link
Contributor

KonkretneKosteczki commented Aug 1, 2022

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.

return dataProvider.getOne(resourceName, {id})
.then(_ => undefined)
.catch(_ => id);

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

@KonkretneKosteczki KonkretneKosteczki changed the title Colliding ids for disableGetManyoption Colliding ids for disableGetMany option Aug 1, 2022
@KonkretneKosteczki
Copy link
Contributor Author

KonkretneKosteczki commented Sep 2, 2022

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.

@benwinding
Copy link
Owner

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 👍

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

2 participants