mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 03:13:47 +00:00
05cf7c7c56
The runtime report joined live report data against the current rundown, so editing an event after the show silently rewrote the report of a show that had already happened. Durations, and the over/under chip in the rundown, would change to match the edit. Each event now records the schedule it actually ran on, and the report is read from that. - OntimeEventReport carries scheduledStart and scheduledDuration, captured when the event starts, plus a playCount so an event started twice no longer overwrites its own record without trace. - The over/under calculation moves to ontime-utils, where the rundown chip and the settings panel share one implementation instead of deriving it separately and disagreeing. - The report panel gains a summary of the show: planned against actual, drift, and how many events landed over, under or on time. - Export CSV was rendering a trash bin icon. No change to how or where anything is stored: the report stays in memory exactly as before. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019nr3FbLbM8gB8Jm771YgTV
27 lines
833 B
TypeScript
27 lines
833 B
TypeScript
import axios from 'axios';
|
|
import { OntimeReport } from 'ontime-types';
|
|
|
|
import { ontimeQueryClient } from '../../common/queryClient';
|
|
import { REPORT, apiEntryUrl } from './constants';
|
|
import type { RequestOptions } from './requestOptions';
|
|
|
|
export const reportUrl = `${apiEntryUrl}/report`;
|
|
|
|
/**
|
|
* HTTP request to fetch all reports
|
|
*/
|
|
export async function fetchReport(options?: RequestOptions): Promise<OntimeReport> {
|
|
const res = await axios.get(reportUrl, { signal: options?.signal });
|
|
return res.data;
|
|
}
|
|
|
|
export async function deleteReport(id: string) {
|
|
await axios.delete(`${reportUrl}/${id}`);
|
|
await ontimeQueryClient.invalidateQueries({ queryKey: REPORT });
|
|
}
|
|
|
|
export async function deleteAllReport() {
|
|
await axios.delete(`${reportUrl}/all`);
|
|
await ontimeQueryClient.invalidateQueries({ queryKey: REPORT });
|
|
}
|