mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2026-01-19 14:02:25 +01:00
lint:#13 formatted
This commit is contained in:
@@ -73,18 +73,22 @@ const selectedRoom = computed(() => props.room);
|
||||
|
||||
/**
|
||||
* Transform decoded JSON object with binary data
|
||||
* to anonymized occupancy events
|
||||
* to anonymized occupancy events
|
||||
* @param data RoomOccupancyList with binary data
|
||||
* @returns Anonymized occupancy events
|
||||
*/
|
||||
function transformData(data: RoomOccupancyList) {
|
||||
const events = data
|
||||
.decodeOccupancy(selectedRoom.value, new Date(currentDateFrom.value), new Date(currentDateTo.value))
|
||||
.decodeOccupancy(
|
||||
selectedRoom.value,
|
||||
new Date(currentDateFrom.value),
|
||||
new Date(currentDateTo.value),
|
||||
)
|
||||
.map((event, index) => ({
|
||||
id: index,
|
||||
event: event,
|
||||
}));
|
||||
return events;
|
||||
return events;
|
||||
}
|
||||
|
||||
const { data: occupations } = useQuery({
|
||||
@@ -92,7 +96,7 @@ const { data: occupations } = useQuery({
|
||||
queryFn: () =>
|
||||
fetchRoomOccupancy(
|
||||
new Date(currentDateFrom.value).toISOString(),
|
||||
new Date(currentDateTo.value).toISOString()
|
||||
new Date(currentDateTo.value).toISOString(),
|
||||
),
|
||||
select: (data) => transformData(data),
|
||||
enabled: () => selectedRoom.value !== "" && currentDateFrom.value !== "",
|
||||
@@ -185,17 +189,15 @@ const calendarOptions: ComputedRef<CalendarOptions> = computed(() => ({
|
||||
id: event.id.toString(),
|
||||
start: event.event.start,
|
||||
end: event.event.end,
|
||||
color: event.event.free
|
||||
? "var(--htwk-gruen-500)"
|
||||
color: event.event.free
|
||||
? "var(--htwk-gruen-500)"
|
||||
: "var(--htwk-grau-60-500)",
|
||||
textColor: event.event.free
|
||||
? "var(--green-50)"
|
||||
: "white",
|
||||
textColor: event.event.free ? "var(--green-50)" : "white",
|
||||
title: event.event.stub
|
||||
? t("roomFinderPage.stub")
|
||||
: event.event.free
|
||||
? t("roomFinderPage.available")
|
||||
: t("roomFinderPage.occupied"),
|
||||
? t("roomFinderPage.available")
|
||||
: t("roomFinderPage.occupied"),
|
||||
} as EventInput;
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user