summaryrefslogtreecommitdiff
path: root/app/src/store/index.ts
blob: 6001d908094895e08a2088c581c2b91a6063032b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { createStore } from "vuex";
import auth from "./modules/auth";
import { toastController } from "@ionic/vue";

const store = createStore({
    state: {
        api: process.env.VUE_APP_BACKEND_URL,
    },
    actions: {
        // eslint-disable-next-line
        async toast({ commit }, data: any) {
            const toast = await toastController.create({
                header: data.header,
                message: data.text,
                color: data.color,
                duration: 2000,
                position: "top",
            });
            return toast.present();
        },
    },
    modules: {
        auth,
    },
});

export default store;