1
0

fix: Typo
Remote Deploy / deploy (push) Successful in 1m18s

This commit is contained in:
2026-06-02 15:45:55 +02:00
parent 32b31814e2
commit 1e971a0601
2 changed files with 6 additions and 5 deletions
@@ -2,7 +2,7 @@ const API_BASE_URL = process.env.ANNOUNCEMENT_API || "http://localhost:3000";
export type Announcement = { export type Announcement = {
id: number; id: number;
text_content: string; text_content?: string;
author: string; author: string;
flags: Flag[]; flags: Flag[];
start_date: string; start_date: string;
+5 -4
View File
@@ -18,7 +18,7 @@ import parseTeachers from "../utils/parseTeachers.js"
import ExcelJS, { Worksheet, Cell, Row, Workbook } from "exceljs" import ExcelJS, { Worksheet, Cell, Row, Workbook } from "exceljs"
import JSZip from "jszip"; import JSZip from "jszip";
import { parseStringPromise } from "xml2js"; import { parseStringPromise } from "xml2js";
import getAnnouncements, { Flag } from "../api/annoucements.js"; import getAnnouncements, { Flag } from "../api/announcements.js";
interface ThemeColors { interface ThemeColors {
[key: number]: string | null; [key: number]: string | null;
@@ -130,12 +130,12 @@ export default async function parseV3(workbook: Workbook, downloadedFilePath: st
if (new Date().getDay() === 0) { if (new Date().getDay() === 0) {
announcementDates.push(...getWeekDates(7)); announcementDates.push(...getWeekDates(7));
} }
const annoucements = await getAnnouncements([...new Set(announcementDates)]); const announcements = await getAnnouncements([...new Set(announcementDates)]);
const schedule: any = {}; const schedule: any = {};
for (const { dateKey, sheet } of resolvedDays) { for (const { dateKey, sheet } of resolvedDays) {
const ann = annoucements[dateKey]; const ann = announcements[dateKey];
const allFlags = ann.map(a => a.flags).flat(); const allFlags = ann.map(a => a.flags).flat();
const { changes, absence, inWork, takesPlace, reservedRooms } = extractDaySchedule(sheet, teacherMap, themeColors, allFlags); const { changes, absence, inWork, takesPlace, reservedRooms } = extractDaySchedule(sheet, teacherMap, themeColors, allFlags);
@@ -151,7 +151,7 @@ export default async function parseV3(workbook: Workbook, downloadedFilePath: st
const data = { const data = {
status: { lastUpdated: formatNowTime() }, status: { lastUpdated: formatNowTime() },
annoucements, announcements,
schedule, schedule,
}; };
@@ -239,6 +239,7 @@ function isPripravaSheet(name: string) {
// //
function extractClassChanges(sheet: Worksheet, themeColors: ThemeColors | null, flags: Flag[]) { function extractClassChanges(sheet: Worksheet, themeColors: ThemeColors | null, flags: Flag[]) {
console.log(flags)
const ignoreColors = flags.includes(Flag.SHOW_ALL_ENTRIES) const ignoreColors = flags.includes(Flag.SHOW_ALL_ENTRIES)
const classRegex = /[AEC][0-4][a-c]?\s*\/.*/s; const classRegex = /[AEC][0-4][a-c]?\s*\/.*/s;
const prefixRegex = /[AEC][0-4][a-c]?/; const prefixRegex = /[AEC][0-4][a-c]?/;