From 99d0e7f9254a18212e090d8edb6c0c293fdb3117 Mon Sep 17 00:00:00 2001 From: alexeh Date: Thu, 9 Mar 2023 17:13:42 +0300 Subject: [PATCH] Fix location type enum sorting --- .../modules/sourcing-locations/sourcing-locations.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/modules/sourcing-locations/sourcing-locations.service.ts b/api/src/modules/sourcing-locations/sourcing-locations.service.ts index a7ae1a449..355b0cc24 100644 --- a/api/src/modules/sourcing-locations/sourcing-locations.service.ts +++ b/api/src/modules/sourcing-locations/sourcing-locations.service.ts @@ -255,7 +255,7 @@ export class SourcingLocationsService extends AppBaseService< .sort((a: { locationType: string }, b: { locationType: string }) => { const comparison: number = a.locationType.toLowerCase() < b.locationType.toLowerCase() ? -1 : 1; - return options.sort === 'DESC' ? comparison * -1 : comparison; + return options.sort === 'DESC' ? comparison : comparison * -1; }); return { data: locationTypeParser(locationTypes) };