Sorted out reactivity with storeToRefs
Some checks failed
Build BAB Application Deployment Artifact / build (push) Failing after 2m1s
Some checks failed
Build BAB Application Deployment Artifact / build (push) Failing after 2m1s
This commit is contained in:
@@ -102,7 +102,7 @@ import { useAuthStore } from 'src/stores/auth';
|
||||
import { Boat, useBoatStore } from 'src/stores/boat';
|
||||
import { date } from 'quasar';
|
||||
import { useScheduleStore } from 'src/stores/schedule';
|
||||
import { Timeblock } from 'src/stores/schedule.types';
|
||||
import { TimeBlock } from 'src/stores/schedule.types';
|
||||
import BoatScheduleTableComponent from 'src/components/scheduling/boat/BoatScheduleTableComponent.vue';
|
||||
|
||||
interface BookingForm {
|
||||
@@ -119,7 +119,7 @@ const auth = useAuthStore();
|
||||
const dateFormat = 'MMM D, YYYY h:mm A';
|
||||
const resourceView = ref(true);
|
||||
const scheduleStore = useScheduleStore();
|
||||
const timeblock = ref<Timeblock>();
|
||||
const timeblock = ref<TimeBlock>();
|
||||
const bookingForm = ref<BookingForm>({
|
||||
bookingId: scheduleStore.getNewId(),
|
||||
name: auth.currentUser?.name,
|
||||
@@ -131,7 +131,7 @@ const bookingForm = ref<BookingForm>({
|
||||
});
|
||||
|
||||
watch(timeblock, (tb_new) => {
|
||||
bookingForm.value.boat = useBoatStore().boats.value.find(
|
||||
bookingForm.value.boat = useBoatStore().boats.find(
|
||||
(b) => b.$id === tb_new?.boatId
|
||||
);
|
||||
bookingForm.value.startDate = date.formatDate(tb_new?.start, dateFormat);
|
||||
|
||||
Reference in New Issue
Block a user