summaryrefslogtreecommitdiff
path: root/app/src/store/index.ts
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-11-12 17:14:40 +0100
committerSanto Cariotti <santo@dcariotti.me>2022-11-12 17:14:40 +0100
commit5e89ad0836ca38b132d1748603be7d8593b9bcb2 (patch)
tree25ec2a2f62b95616b5587754f1bded6e34f890ec /app/src/store/index.ts
parente4e6653f754b6d2857bcf03a89d26c3e24083271 (diff)
Add signup page
Diffstat (limited to 'app/src/store/index.ts')
-rw-r--r--app/src/store/index.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/app/src/store/index.ts b/app/src/store/index.ts
new file mode 100644
index 0000000..6001d90
--- /dev/null
+++ b/app/src/store/index.ts
@@ -0,0 +1,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;