diff --git a/frontend/src/api/createFeed.ts b/frontend/src/api/createFeed.ts index 2c89049..126f87b 100644 --- a/frontend/src/api/createFeed.ts +++ b/frontend/src/api/createFeed.ts @@ -10,7 +10,11 @@ export async function createIndividualFeed(modules: Module[]): Promise { body: JSON.stringify(modules), }); - if (response.status === 429 || response.status === 500 || response.status != 200) { + if ( + response.status === 429 || + response.status === 500 || + response.status != 200 + ) { return Promise.reject(response.statusText); } diff --git a/frontend/src/components/RenameModules.vue b/frontend/src/components/RenameModules.vue index 17f2eee..dfbadbc 100644 --- a/frontend/src/components/RenameModules.vue +++ b/frontend/src/components/RenameModules.vue @@ -37,7 +37,9 @@ const columns = computed(() => [ const toast = useToast(); async function finalStep() { - const createFeed: Promise= createIndividualFeed(store.getAllModules()); + const createFeed: Promise = createIndividualFeed( + store.getAllModules(), + ); // Check if createFeed Promise is resolved createFeed.then(async (token: string) => { diff --git a/frontend/src/components/RoomOccupation.vue b/frontend/src/components/RoomOccupation.vue index 20db0e5..6a01952 100644 --- a/frontend/src/components/RoomOccupation.vue +++ b/frontend/src/components/RoomOccupation.vue @@ -18,7 +18,7 @@ const props = defineProps({ type: Date, required: false, default: null, - } + }, }); type CalenderEvent = { @@ -28,7 +28,7 @@ type CalenderEvent = { showFree: boolean; }; -const propDate: Ref = ref(props.date); +const propDate: Ref = ref(props.date); const currentDateFrom: Ref = ref(""); const currentDateTo: Ref = ref(""); @@ -131,14 +131,13 @@ const calendarOptions: ComputedRef = computed(() => ({ }, datesSet: function (dateInfo: DatesSetArg) { - - if(propDate.value !== null) { + if (propDate.value !== null) { console.debug("props.date: ", props.date); const date = new Date(props.date); // calculate the week start and end date which includes the date const weekStart = new Date(date); - weekStart.setDate(date.getDate() - date.getDay()+1); + weekStart.setDate(date.getDate() - date.getDay() + 1); const weekEnd = new Date(date); weekEnd.setDate(date.getDate() - date.getDay() + 6); currentDateFrom.value = weekStart.toISOString().split("T")[0]; @@ -147,7 +146,9 @@ const calendarOptions: ComputedRef = computed(() => ({ } else { const view = dateInfo.view; const offset = new Date().getTimezoneOffset(); - const startDate = new Date(view.activeStart.getTime() - offset * 60 * 1000); + const startDate = new Date( + view.activeStart.getTime() - offset * 60 * 1000, + ); const endDate = new Date(view.activeEnd.getTime() - offset * 60 * 1000); currentDateFrom.value = startDate.toISOString().split("T")[0]; currentDateTo.value = endDate.toISOString().split("T")[0]; diff --git a/frontend/src/view/FreeRooms.vue b/frontend/src/view/FreeRooms.vue index 0fc62f2..9b65bb1 100644 --- a/frontend/src/view/FreeRooms.vue +++ b/frontend/src/view/FreeRooms.vue @@ -142,14 +142,13 @@ const filters = ref({ function occupationRoute(room: string): void { // date is in format like YYYYMMDD - router.push({ - name: "room-schedule", - query: { - room: room, - date: date.value.toISOString().split("T")[0].replace(/-/g, ""), - } - } - ); + router.push({ + name: "room-schedule", + query: { + room: room, + date: date.value.toISOString().split("T")[0].replace(/-/g, ""), + }, + }); } const date: Ref = ref(new Date(Date.now())); diff --git a/frontend/src/view/RoomFinder.vue b/frontend/src/view/RoomFinder.vue index bafabca..8834715 100644 --- a/frontend/src/view/RoomFinder.vue +++ b/frontend/src/view/RoomFinder.vue @@ -22,22 +22,24 @@ const room = urlParams.get("room"); const roomsList = computedAsync(async () => { let rooms: { name: string }[] = []; - return await fetchRoom().then((data) => - rooms = data.map((room: string) => { - return { name: room }; - }), - ).finally(() => { - if (room) { - // check if room is available in roomsList - isRoomAvailable(room, rooms) - } - }); -}, -[]); + return await fetchRoom() + .then( + (data) => + (rooms = data.map((room: string) => { + return { name: room }; + })), + ) + .finally(() => { + if (room) { + // check if room is available in roomsList + isRoomAvailable(room, rooms); + } + }); +}, []); -const selectedDate: Ref = ref(null); +const selectedDate: Ref = ref(undefined); -// Set the selected date from the URL +// Set the selected date from the UR const date = urlParams.get("date"); if (date) { // date is in format like YYYYMMDD