Add tables for almost every admin change, update composer dependencies
This commit is contained in:
parent
8f1a5bf0ab
commit
59de9576c9
42 changed files with 3327 additions and 1241 deletions
27
resources/scripts/state/admin/locations.ts
Normal file
27
resources/scripts/state/admin/locations.ts
Normal file
|
@ -0,0 +1,27 @@
|
|||
import { action, Action } from 'easy-peasy';
|
||||
|
||||
export interface AdminLocationStore {
|
||||
selectedLocations: number[];
|
||||
|
||||
setSelectedLocations: Action<AdminLocationStore, number[]>;
|
||||
appendSelectedLocation: Action<AdminLocationStore, number>;
|
||||
removeSelectedLocation: Action<AdminLocationStore, number>;
|
||||
}
|
||||
|
||||
const locations: AdminLocationStore = {
|
||||
selectedLocations: [],
|
||||
|
||||
setSelectedLocations: action((state, payload) => {
|
||||
state.selectedLocations = payload;
|
||||
}),
|
||||
|
||||
appendSelectedLocation: action((state, payload) => {
|
||||
state.selectedLocations = state.selectedLocations.filter(id => id !== payload).concat(payload);
|
||||
}),
|
||||
|
||||
removeSelectedLocation: action((state, payload) => {
|
||||
state.selectedLocations = state.selectedLocations.filter(id => id !== payload);
|
||||
}),
|
||||
};
|
||||
|
||||
export default locations;
|
Loading…
Add table
Add a link
Reference in a new issue