Add server info store

This commit is contained in:
rijkvanzanten
2020-10-26 18:53:08 +01:00
parent b4f82efcee
commit 8a01d9b2de

18
app/src/stores/server.ts Normal file
View File

@@ -0,0 +1,18 @@
import { createStore } from 'pinia';
import api from '@/api';
export const useServerStore = createStore({
id: 'serverStore',
state: () => ({
info: null,
}),
actions: {
async hydrate() {
const response = await api.get(`/server/info`);
this.state.info = response.data.data;
},
dehydrate() {
this.reset();
},
},
});