3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-12 05:27:19 +00:00

dashboard: add staff vuex store

This commit is contained in:
Dragory 2020-05-23 16:28:05 +03:00
parent 76dc049332
commit 27f0046d50
3 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,24 @@
import { get, post } from "../api";
import { Module } from "vuex";
import { RootState, StaffState } from "./types";
export const StaffStore: Module<StaffState, RootState> = {
namespaced: true,
state: {
isStaff: false,
},
actions: {
async checkStatus({ commit }) {
const status = await get("staff/status");
commit("setStatus", status.isStaff);
},
},
mutations: {
setStatus(state: StaffState, value: boolean) {
state.isStaff = value;
},
},
};