Files
mixtape/zero.Backoffice.UI/app/ui/store.ts
T
2021-12-09 14:18:38 +01:00

27 lines
635 B
TypeScript

import { defineStore } from 'pinia';
import { UiIconSet, UiSection, UiSettingsGroup, UiStoreState } from 'zero/ui';
import api from './api';
export const useUiStore = defineStore('zero.ui', {
state: () => ({
sections: [],
settingGroups: [],
iconSets: []
} as UiStoreState),
actions: {
async setup()
{
const values = await Promise.all([
api.getSections(),
api.getSettingGroups(),
api.getIconSets()
]);
this.sections = values[0] as UiSection[];
this.settingGroups = values[1] as UiSettingsGroup[];
this.iconSets = values[2] as UiIconSet[];
}
}
});