fixed calendar attendance grouping
This commit is contained in:
@@ -26,7 +26,7 @@ export interface CalendarSignup {
|
||||
eventID: number;
|
||||
status: CalendarAttendance;
|
||||
member_name?: string;
|
||||
member_unit?: string;
|
||||
unit_name?: string;
|
||||
}
|
||||
|
||||
export interface CalendarEventShort {
|
||||
|
||||
@@ -104,11 +104,11 @@ const attendanceTab = ref<"Alpha" | "Echo" | "Other">("Alpha");
|
||||
const attendanceList = computed<CalendarSignup[]>(() => {
|
||||
let out: CalendarSignup[] = [];
|
||||
if (attendanceTab.value === 'Alpha') {
|
||||
out = activeEvent.value.eventSignups?.filter((s) => s.member_unit === 'Alpha Company');
|
||||
out = activeEvent.value.eventSignups?.filter((s) => s.unit_name === 'Alpha Company');
|
||||
} else if (attendanceTab.value === 'Echo') {
|
||||
out = activeEvent.value.eventSignups?.filter((s) => s.member_unit === 'Echo Company')
|
||||
out = activeEvent.value.eventSignups?.filter((s) => s.unit_name === 'Echo Company')
|
||||
} else {
|
||||
out = activeEvent.value.eventSignups?.filter((s) => s.member_unit != 'Alpha Company' && s.member_unit != 'Echo Company')
|
||||
out = activeEvent.value.eventSignups?.filter((s) => s.unit_name != 'Alpha Company' && s.unit_name != 'Echo Company')
|
||||
}
|
||||
|
||||
const statusOrder: Record<CalendarAttendance, number> = {
|
||||
@@ -126,11 +126,11 @@ const attendanceCountsByGroup = computed(() => {
|
||||
const signups = activeEvent.value.eventSignups ?? [];
|
||||
|
||||
return {
|
||||
Alpha: signups.filter(s => s.member_unit === "Alpha Company").length,
|
||||
Echo: signups.filter(s => s.member_unit === "Echo Company").length,
|
||||
Alpha: signups.filter(s => s.unit_name === "Alpha Company").length,
|
||||
Echo: signups.filter(s => s.unit_name === "Echo Company").length,
|
||||
Other: signups.filter(s =>
|
||||
s.member_unit !== "Alpha Company" &&
|
||||
s.member_unit !== "Echo Company"
|
||||
s.unit_name !== "Alpha Company" &&
|
||||
s.unit_name !== "Echo Company"
|
||||
).length,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user