diff --git a/resources/basya.js b/resources/basya.js index 2cb0e3d..2db730f 100644 --- a/resources/basya.js +++ b/resources/basya.js @@ -1,5 +1,6 @@ import './js/bootstrap'; import {createApp} from 'vue' +import { createPinia } from 'pinia' import App from './views/basya/Basya.vue' import { createVuetify } from 'vuetify' import { mdi } from "vuetify/iconsets/mdi"; @@ -8,9 +9,11 @@ import * as components from 'vuetify/components' import * as directives from 'vuetify/directives' import '@mdi/font/css/materialdesignicons.css' +const pinia = createPinia(); + const vuetify = createVuetify({ components, directives }) -createApp(App).use(vuetify).mount("#app") +createApp(App).use(vuetify).use(pinia).mount("#app") diff --git a/resources/stores/Schedule.js b/resources/stores/Schedule.js deleted file mode 100644 index 8c07e3c..0000000 --- a/resources/stores/Schedule.js +++ /dev/null @@ -1,15 +0,0 @@ -import {defineStore} from "pinia"; - -export const useScheduleStore = defineStore('Schedule', { - state: () => ({ - fetchingDates: true, - fetchingTable: true, - fetchingLinks: true - }), - getters: { - - }, - actions: { - - }, -}) diff --git a/resources/stores/basya.js b/resources/stores/basya.js new file mode 100644 index 0000000..e0e281c --- /dev/null +++ b/resources/stores/basya.js @@ -0,0 +1,20 @@ +import {defineStore} from "pinia"; +import axios from "axios"; + +export const useBasyaStore = defineStore('basya', { + state: () => ({ + phrases: Object + }), + getters: { + + }, + actions: { + async getPhrases(){ + await axios + .get('/api/v1/phrases') + .then((response) => { + this.phrases = response.data; + }); + } + }, +}) diff --git a/resources/stores/schedule.js b/resources/stores/schedule.js new file mode 100644 index 0000000..8715282 --- /dev/null +++ b/resources/stores/schedule.js @@ -0,0 +1,37 @@ +import {defineStore} from "pinia"; +import axios from "axios"; + +export const useScheduleStore = defineStore('schedule', { + state: () => ({ + dates: Object, + links: Object, + schedules: Object + }), + getters: { + + }, + actions: { + async getDates(){ + await axios + .get('/api/v1/dates') + .then((response) => { + this.dates = response.data; + }); + }, + async getLinks(){ + await axios + .get('/api/v1/links') + .then((response)=>{ + this.links = response.data; + }) + }, + async getSchedules(){ + await axios + .get('/api/v1/schedules') + .then((response)=>{ + this.schedules = response.data; + }) + } + + }, +}) diff --git a/resources/views/Schedule.vue b/resources/views/Schedule.vue index 803da12..2105671 100644 --- a/resources/views/Schedule.vue +++ b/resources/views/Schedule.vue @@ -10,33 +10,30 @@ diff --git a/resources/views/Schedule/Links.vue b/resources/views/Schedule/Links.vue index 30d62ab..3fb6ce0 100644 --- a/resources/views/Schedule/Links.vue +++ b/resources/views/Schedule/Links.vue @@ -1,22 +1,22 @@ diff --git a/resources/views/basya/Basya.vue b/resources/views/basya/Basya.vue index 905413a..36cc44d 100644 --- a/resources/views/basya/Basya.vue +++ b/resources/views/basya/Basya.vue @@ -34,7 +34,8 @@