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

sort by country.name is not work properly #1299

Conversation

Ivanov-Anton
Copy link
Collaborator

@Ivanov-Anton Ivanov-Anton commented Jun 21, 2023

when performing GET /api/rest/admin/routing/destinations?sort=country.name we have crash

SELECT "class4"."destinations".* FROM "class4"."destinations"
LEFT JOIN sys.countries AS country_sorting ON country_sorting.id = class4.destinations.country_id
LEFT JOIN class4.rate_groups AS rate_group_sorting ON rate_group_sorting.id = class4.destinations.rate_group_id
ORDER BY country_sorting.name asc, rate_group_sorting.name asc LIMIT $1 OFFSET $2  [["LIMIT", 50], ["OFFSET", 0]]


Internal Server Error: PG::UndefinedColumn: ERROR:  column destinations.country_id does not exist
LINE 1: ...ntries AS country_sorting ON country_sorting.id = class4.des...
                                                             ^

closes #1300

@Ivanov-Anton Ivanov-Anton added bug Admin API tasks related to /api/rest/admin API labels Jun 21, 2023
@Ivanov-Anton Ivanov-Anton self-assigned this Jun 21, 2023
@Ivanov-Anton Ivanov-Anton changed the title sort by country.name which is not directly association but through ne… sort by country.name is not work properly Jun 21, 2023
@Ivanov-Anton Ivanov-Anton marked this pull request as draft June 21, 2023 08:12
@Ivanov-Anton Ivanov-Anton force-pushed the sort-by-country-name-when-include-country branch 4 times, most recently from 716aef7 to 7b5293c Compare June 21, 2023 11:40
@Ivanov-Anton Ivanov-Anton marked this pull request as ready for review June 21, 2023 12:15
…twork_prefix

the bug is next:
when we try to sort destinations by country.name we have 500 error

affected API resource /api/rest/admin/routing/destinations
@Ivanov-Anton Ivanov-Anton force-pushed the sort-by-country-name-when-include-country branch from 7b5293c to 3ff87de Compare June 21, 2023 13:42
@gigorok gigorok merged commit 45d04f4 into yeti-switch:master Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin API tasks related to /api/rest/admin API bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ADMIN API: error when try to sort destinations by country.name
3 participants