fix:#30 format, lint and fixed types

This commit is contained in:
Elmar Kresse
2024-02-23 02:50:01 +01:00
parent b4caa9e94b
commit 27b1b591cc
5 changed files with 38 additions and 30 deletions

View File

@@ -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<Date> = ref(new Date(Date.now()));

View File

@@ -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<Date|null> = ref(null);
const selectedDate: Ref<Date | undefined> = 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