Refactor Reservations into new store
All checks were successful
Build BAB Application Deployment Artifact / build (push) Successful in 2m2s
All checks were successful
Build BAB Application Deployment Artifact / build (push) Successful in 2m2s
This commit is contained in:
@@ -114,7 +114,7 @@ import {
|
||||
parsed,
|
||||
} from '@quasar/quasar-ui-qcalendar';
|
||||
import { Boat, useBoatStore } from 'src/stores/boat';
|
||||
import { useScheduleStore } from 'src/stores/schedule';
|
||||
import { useReservationStore } from 'src/stores/reservation';
|
||||
import { date } from 'quasar';
|
||||
import { computed } from 'vue';
|
||||
import type { StatusTypes } from 'src/stores/schedule.types';
|
||||
@@ -146,7 +146,7 @@ const statusLookup = {
|
||||
|
||||
const calendar = ref();
|
||||
const boatStore = useBoatStore();
|
||||
const scheduleStore = useScheduleStore();
|
||||
const reservationStore = useReservationStore();
|
||||
const selectedDate = ref(today());
|
||||
const duration = ref(1);
|
||||
|
||||
@@ -172,7 +172,7 @@ function monthFormatter() {
|
||||
}
|
||||
|
||||
function getEvents(scope: ResourceIntervalScope) {
|
||||
const resourceEvents = scheduleStore.getBoatReservations(
|
||||
const resourceEvents = reservationStore.getBoatReservations(
|
||||
parseDate(date.extractDate(selectedDate.value, 'YYYY-MM-DD')) as Timestamp,
|
||||
scope.resource.$id
|
||||
);
|
||||
|
||||
@@ -79,8 +79,10 @@ import { useScheduleStore } from 'src/stores/schedule';
|
||||
import { useAuthStore } from 'src/stores/auth';
|
||||
import { Interval, Reservation } from 'src/stores/schedule.types';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useReservationStore } from 'src/stores/reservation';
|
||||
|
||||
const scheduleStore = useScheduleStore();
|
||||
const reservationStore = useReservationStore();
|
||||
const { boats } = storeToRefs(useBoatStore());
|
||||
const selectedBlock = defineModel<Interval | null>();
|
||||
const selectedDate = ref(today());
|
||||
@@ -187,7 +189,7 @@ function getBoatBlocks(scope: DayBodyScope): Interval[] {
|
||||
function getBoatReservations(scope: DayBodyScope): Reservation[] {
|
||||
const boat = boats.value[scope.columnIndex];
|
||||
return boat
|
||||
? scheduleStore.getBoatReservations(scope.timestamp, boat.$id)
|
||||
? reservationStore.getBoatReservations(scope.timestamp, boat.$id)
|
||||
: [];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user