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

Invalid mapping of parameters - empty string #21

Open
daugsbi opened this issue Mar 23, 2020 · 0 comments
Open

Invalid mapping of parameters - empty string #21

daugsbi opened this issue Mar 23, 2020 · 0 comments

Comments

@daugsbi
Copy link

daugsbi commented Mar 23, 2020

Hi, thanks a lot for this dataprovider. It works pretty well.
I've just stumbled over the following problem.

Reproduction

Create a ReferenceInput with an AutocompleteInput. The query that is build at the initialization (Empty search string) is the following, which results in an "Invalid filter value" backend error.
http://API/users?filter[0]=email||cont&limit=100&page=1&sort[0]=email%2CASC&offset=0

<ReferenceInput
        label="Benutzer"
        source="userId"
        reference="users"
        validate={[required()]}
        sort={{ field: "email", order: "ASC" }}
        perPage={100}
        // This results in an error
        filterToQuery={(search: string) => ({ email: search })}
        // This is a workaround
        filterToQuery={(search: string) => ({ email: search ? search : " "  })}
     >
        <AutocompleteInput optionText="email" optionValue="id" />
</ReferenceInput>
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

1 participant