Skip to content
This repository has been archived by the owner on Feb 6, 2025. It is now read-only.

getSortQuery in pleco-knex does not mutate query #18

Open
the-chosen-one opened this issue Apr 24, 2019 · 1 comment
Open

getSortQuery in pleco-knex does not mutate query #18

the-chosen-one opened this issue Apr 24, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@the-chosen-one
Copy link

When using the getSortQuery from pleco-knex when making a call with the { mutate: true } flag the original query is not mutated. Instead of calling

getSortQuery({ sort, subqueries }, { knex: this.knex, query, mutate: true })

to change the query, we must now do this:

query = getSortQuery({ sort, subqueries }, { knex: this.knex, query, mutate: true })
@thekuom thekuom added bug Something isn't working good first issue Good for newcomers labels Apr 24, 2019
@thekuom
Copy link
Collaborator

thekuom commented Apr 24, 2019

I'm interested to see if we would have to re-evaluate the sorting strategy. What the function is doing now is it wraps the original query with another query and then returns. Unlike the filtering function which never re-assigns the query param

@thekuom thekuom removed the good first issue Good for newcomers label Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants