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

Value in json is string, but filter type is number #544

Closed
adaamz opened this issue Aug 3, 2017 · 3 comments
Closed

Value in json is string, but filter type is number #544

adaamz opened this issue Aug 3, 2017 · 3 comments
Labels
feature New feature
Milestone

Comments

@adaamz
Copy link

adaamz commented Aug 3, 2017

Hi,
I have this queryBuilder

$qb.queryBuilder({
operators: [{
                    type: 'create',
                    nb_inputs: 1,
                    apply_to: 'select'
                }],
filters: [{
                    id: 'abc',
                    label: 'abc',
                    input: 'select',
                    type: 'integer',
                    operators: ['create'],
                    values: [1,2,3,4,5,6]
                }]
});

but in exported json the value for filter is always string (quoted number).

Is there any option to change that?

Thanks.

@jvincilione
Copy link

I'm pretty sure SQL doesn't care if it's a string or an int (I know mysql doesn't for sure). Are you running into an issue?

@mistic100
Copy link
Owner

I never seen the interest in having the good type in the JSON output, usually you have a backend parser that translate it to a POJO (or same thing in other languages) and do not to worry about types.

But it could be done.

@mistic100 mistic100 added the feature New feature label Aug 4, 2017
@mistic100 mistic100 added this to the 2.4.5 milestone Aug 4, 2017
@adaamz
Copy link
Author

adaamz commented Aug 4, 2017

Yes, I hotfixed it with explicitly casting to integer. But it would be nice to have correct type in javascript too :-)

Thank you.

ps. I do not use it for sql filter of course. I use it as configurator and then save json to database and other service reads it.

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

No branches or pull requests

3 participants