Refactor Reservations into new store
All checks were successful
Build BAB Application Deployment Artifact / build (push) Successful in 2m2s

This commit is contained in:
2024-05-13 12:42:10 -04:00
parent b0921ccf32
commit dd631b71bb
6 changed files with 96 additions and 89 deletions

View File

@@ -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)
: [];
}