File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11import { defineStore } from "pinia" ;
22import GraphClient from "@/lib/GraphClient/GraphClient.js" ;
33import objectTypesQuery from "@/lib/GraphClient/queries/getObjectTypes.json" ;
4+ import { orderBy } from "lodash" ;
45
56const CLIENT = new GraphClient ( ) ;
67
@@ -17,9 +18,14 @@ export const useObjectTypesStore = defineStore("objectTypes", {
1718 response [ "objectTypes" ] . records &&
1819 response [ "objectTypes" ] . records . length
1920 ) {
20- const objectTypesList = response [ "objectTypes" ] . records . map (
21- ( { label } ) => label ,
21+ //Sort the object types alphabetically
22+ let objectTypesList = orderBy (
23+ response [ "objectTypes" ] . records ,
24+ [ "label" ] ,
25+ [ "asc" ] ,
2226 ) ;
27+
28+ objectTypesList = objectTypesList . map ( ( { label } ) => label ) ;
2329 this . objectTypes = objectTypesList ;
2430 }
2531
You can’t perform that action at this time.
0 commit comments