forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits

insightRunReportUrl.ts16 lines, 758 bytesHistoryRawDownload
1/**
2 * One run day's school report door, spelled once: the two requests go through
3 * `client`/`blobClient`, which add `/api` themselves, while the download link
4 * has to carry the prefix — so the prefixed form is built from the same path.
5 *
6 * `runDay` is the ledger row's own `run_day` (`YYYY-MM-DD`). A day nothing was
7 * generated for answers `409 report_missing`; a caller below manager is refused.
8 */
9export function insightRunReportPath(runDay: string): string {
10 return `/insights/runs/${encodeURIComponent(runDay)}/report`;
11}
12
13/** The same door as a same-origin URL — hand it to an `<a href>`: the session cookie rides along. */
14export function insightRunReportUrl(runDay: string): string {
15 return `/api${insightRunReportPath(runDay)}`;
16}