Client - refactoring workouts (WIP)

separate user workouts from timeline workouts
This commit is contained in:
Sam
2021-11-02 14:02:18 +01:00
parent 288a78e2a0
commit 37596f52f4
8 changed files with 45 additions and 44 deletions

View File

@ -75,7 +75,7 @@
onBeforeMount(() => loadWorkouts())
const workouts: ComputedRef<IWorkout[]> = computed(
() => store.getters[WORKOUTS_STORE.GETTERS.USER_WORKOUTS]
() => store.getters[WORKOUTS_STORE.GETTERS.TIMELINE_WORKOUTS]
)
const moreWorkoutsExist: ComputedRef<boolean> = computed(() =>
workouts.value.length > 0
@ -84,7 +84,7 @@
)
function loadWorkouts() {
store.dispatch(WORKOUTS_STORE.ACTIONS.GET_USER_WORKOUTS, {
store.dispatch(WORKOUTS_STORE.ACTIONS.GET_TIMELINE_WORKOUTS, {
page: page.value,
per_page,
...defaultOrder,
@ -92,7 +92,7 @@
}
function loadMoreWorkouts() {
page.value += 1
store.dispatch(WORKOUTS_STORE.ACTIONS.GET_MORE_USER_WORKOUTS, {
store.dispatch(WORKOUTS_STORE.ACTIONS.GET_MORE_TIMELINE_WORKOUTS, {
page: page.value,
per_page,
...defaultOrder,