From e04bc5ba98826919b2987b1a72cf4fc7e6b907aa Mon Sep 17 00:00:00 2001 From: Dhaverd Date: Sat, 20 Apr 2024 01:08:18 +0800 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=BF=D0=B8=D0=BB=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=81=D1=82=D0=BE=D1=80=20=D0=B4=D0=BB=D1=8F=20=D1=80=D0=B0?= =?UTF-8?q?=D1=81=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=B8=D0=BC=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/stores/schedule.js | 28 +++++++++++++++++++--- resources/views/Schedule.vue | 19 +++++++-------- resources/views/Schedule/Links.vue | 16 ++++++------- resources/views/Schedule/ScheduleTable.vue | 16 ++++++------- 4 files changed, 49 insertions(+), 30 deletions(-) diff --git a/resources/stores/schedule.js b/resources/stores/schedule.js index 8c07e3c..40ab9b0 100644 --- a/resources/stores/schedule.js +++ b/resources/stores/schedule.js @@ -1,15 +1,37 @@ import {defineStore} from "pinia"; +import axios from "axios"; export const useScheduleStore = defineStore('Schedule', { state: () => ({ - fetchingDates: true, - fetchingTable: true, - fetchingLinks: true + 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 @@