Skip to content

Colliding ids for disableGetMany option #90

@KonkretneKosteczki

Description

@KonkretneKosteczki

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions