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

Using eq predicate for id in selected_list input #359

Open
evanhoward-id opened this issue Jul 7, 2021 · 1 comment
Open

Using eq predicate for id in selected_list input #359

evanhoward-id opened this issue Jul 7, 2021 · 1 comment

Comments

@evanhoward-id
Copy link

evanhoward-id commented Jul 7, 2021

I've used search select throughout my codebase and have appreciated the featured that automatically uses the "eq" predicate for the id field, located in the following code.

fields.forEach(function(field) {
if (field == 'id') {
textQuery[field + '_eq'] = params.term;
} else {
textQuery[field + '_' + predicate] = params.term;
}
});

However, this feature is missing from the selected_list input. This causes my code to break with PG::UndefinedFunction: ERROR: operator does not exist: which I believe is because the query is trying to compare an integer against a string. If we added the conditional from the above code block to the below code, it should fix this issue.

fields.forEach(function(field) {
textQuery[field + '_' + predicate] = params.term;
});

I'd imagine this is preferable just to have consistent behavior across these similar input types. If someone has a workaround or is opposed to this change, please let me know!

@evanhoward-id evanhoward-id changed the title Using _eq predicate for id in selected_list input Using eq predicate for id in selected_list input Jul 7, 2021
@petres-a
Copy link

petres-a commented Feb 5, 2024

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants