From 89b018098985ee5ab51748357437822bebe0beb7 Mon Sep 17 00:00:00 2001 From: "D. Scott Boggs" Date: Sat, 26 Aug 2023 11:05:15 -0400 Subject: [PATCH] Move API calls from state to Track methods --- client/src/components/NavBar.vue | 1 - client/src/components/TickComponent.vue | 4 +- client/src/components/TrackIcon.vue | 4 +- client/src/state.ts | 32 +------------ client/src/track.ts | 61 +++++++++++++++++++++++++ client/src/views/NewTrackView.vue | 3 +- 6 files changed, 67 insertions(+), 38 deletions(-) diff --git a/client/src/components/NavBar.vue b/client/src/components/NavBar.vue index 9a09c57..145a817 100644 --- a/client/src/components/NavBar.vue +++ b/client/src/components/NavBar.vue @@ -1,6 +1,5 @@ diff --git a/client/src/components/TickComponent.vue b/client/src/components/TickComponent.vue index 8b1d863..47d57e0 100644 --- a/client/src/components/TickComponent.vue +++ b/client/src/components/TickComponent.vue @@ -15,8 +15,8 @@ const className = computed(() => isSet.value ? "button is-rounded is-info" : "bu async function toggle() { if (isSet.value) { - await state.taskMarkedIncomplete(props.track, props.date) + await props.track.markIncomplete(props.date) } else - await state.taskCompleted(props.track, props.date) + await props.track.markComplete(props.date) } \ No newline at end of file diff --git a/client/src/components/TrackIcon.vue b/client/src/components/TrackIcon.vue index 273987e..e5aeabf 100644 --- a/client/src/components/TrackIcon.vue +++ b/client/src/components/TrackIcon.vue @@ -1,12 +1,12 @@