mirror of
https://github.com/Spythere/station-manager-2.0.git
synced 2026-05-03 13:38:13 +00:00
feature: skrót posterunku
This commit is contained in:
@@ -32,6 +32,7 @@ export const useStore = defineStore('store', {
|
||||
|
||||
changesResponse: [],
|
||||
} as IStore),
|
||||
|
||||
actions: {
|
||||
fetchSceneriesData() {
|
||||
this.dataState = 'LOADING';
|
||||
@@ -95,4 +96,13 @@ export const useStore = defineStore('store', {
|
||||
return axios.post<{ user: IUser }>('auth/token', { token: this.token }, { baseURL });
|
||||
},
|
||||
},
|
||||
|
||||
getters: {
|
||||
sortedStationList(state) {
|
||||
return state.stationList
|
||||
.filter((station) => station.name.toLowerCase().startsWith(state.searchedSceneryName.toLowerCase()))
|
||||
.sort((a, b) => (a.name > b.name ? 1 : -1))
|
||||
.filter((_, i) => i < state.maxVisibleResults);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user