refactor: use geo for sort after backend change

Closes #210
This commit is contained in:
Jovan Krunić
2022-05-18 09:41:18 +02:00
parent b7ae2cf019
commit 9efc41a8f8
5 changed files with 201 additions and 81 deletions

View File

@@ -28,22 +28,6 @@ export class FoodDataListComponent extends SearchPageComponent {
initialize() {
this.showDefaultData = true;
if (this.positionService.position) {
this.sortQuery = [
{
type: 'distance',
order: 'asc',
arguments: {
field: 'geo.point.coordinates',
position: [
this.positionService.position.longitude,
this.positionService.position.latitude,
],
},
},
];
}
this.sortQuery = [
{
arguments: {field: 'name'},
@@ -88,5 +72,21 @@ export class FoodDataListComponent extends SearchPageComponent {
},
type: 'boolean',
};
if (this.positionService.position) {
this.sortQuery = [
{
type: 'distance',
order: 'asc',
arguments: {
field: 'geo',
position: [
this.positionService.position.longitude,
this.positionService.position.latitude,
],
},
},
];
}
}
}