Skip to content

Commit a504f54

Browse files
committed
Added sorting by band code in student Band of residence
1 parent bc0baea commit a504f54

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

frontend/src/store/modules/sdcCollection.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,15 @@ export const sdcCollectionStore = defineStore('sdcCollection', {
7474
this.schoolCollection = schoolCollection;
7575
},
7676
setBandCodes(bandCodes) {
77-
this.bandCodes = bandCodes.map(item => {
77+
this.bandCodes = bandCodes.sort((a,b) => {
78+
if (a.bandCode<b.bandCode) return -1;
79+
if (a.bandCode>b.bandCode) return 1;
80+
return 0;
81+
82+
}).map(item => {
7883
return {...item, dropdownText: `${item.description} (${item.bandCode})`};
7984
});
85+
8086
this.bandCodesMap = new Map();
8187
this.bandCodes.unshift({'bandCode': null, 'dropdownText': 'No Band Code'});
8288
bandCodes.forEach(bandCode => {

0 commit comments

Comments
 (0)