File tree Expand file tree Collapse file tree 2 files changed +7
-17
lines changed
services/device-management Expand file tree Collapse file tree 2 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -42,5 +42,6 @@ export class ListAllEntitiesDto {
4242 | "devices"
4343 | "dataTargets"
4444 | "organizationName"
45- | "commentOnLocation" ;
45+ | "commentOnLocation"
46+ | "statusCheck" ;
4647}
Original file line number Diff line number Diff line change @@ -679,25 +679,14 @@ export class ApplicationService {
679679 private getSortingForApplications ( query : ListAllEntitiesDto ) : Record < string , "ASC" | "DESC" > {
680680 const sorting : Record < string , "ASC" | "DESC" > = { } ;
681681
682- if ( query . orderOn ) {
683- const validFields = new Set ( [
684- "id" ,
685- "name" ,
686- "updatedAt" ,
687- "startDate" ,
688- "endDate" ,
689- "owner" ,
690- "contactPerson" ,
691- "personalData" ,
692- ] ) ;
682+ if ( query . orderOn === "statusCheck" ) {
683+ return sorting ;
684+ }
693685
686+ if ( query . orderOn ) {
694687 const sortOrder = query . sort . toUpperCase ( ) === "DESC" ? "DESC" : "ASC" ;
695688
696- if ( query . orderOn === "status" ) {
697- sorting [ "status" ] = sortOrder ;
698- } else if ( validFields . has ( query . orderOn ) ) {
699- sorting [ `app.${ query . orderOn } ` ] = sortOrder ;
700- }
689+ sorting [ `app.${ query . orderOn } ` ] = sortOrder ;
701690 }
702691
703692 if ( Object . keys ( sorting ) . length === 0 ) {
You can’t perform that action at this time.
0 commit comments