2
0
Эх сурвалжийг харах

♻️ refactor(areas): optimize area query sorting

- add id ascending order to ensure consistent sorting results
- maintain existing level and name sorting while improving result stability
yourname 4 сар өмнө
parent
commit
782933e0ab

+ 4 - 2
src/server/modules/areas/area.service.ts

@@ -12,8 +12,9 @@ export class AreaService {
     const areas = await this.areaRepository.find({
       where: { isDeleted: 0 },
       order: {
+        id: 'ASC',
         level: 'ASC',
-        name: 'ASC'
+        name: 'ASC',
       }
     });
 
@@ -144,8 +145,9 @@ export class AreaService {
         isDisabled: DisabledStatus.ENABLED
       },
       order: {
+        id: 'ASC',
         level: 'ASC',
-        name: 'ASC'
+        name: 'ASC',
       }
     });
   }