fix: match report_schedules JSON key from backend response

This commit is contained in:
Usman Baig
2026-03-12 14:50:51 +01:00
parent acf7b16dde
commit c6ec4671a4

View File

@@ -42,8 +42,8 @@ export interface UpdateReportScheduleRequest {
}
export async function listReportSchedules(siteId: string): Promise<ReportSchedule[]> {
const res = await apiRequest<{ schedules: ReportSchedule[] }>(`/sites/${siteId}/report-schedules`)
return res?.schedules ?? []
const res = await apiRequest<{ report_schedules: ReportSchedule[] }>(`/sites/${siteId}/report-schedules`)
return res?.report_schedules ?? []
}
export async function createReportSchedule(siteId: string, data: CreateReportScheduleRequest): Promise<ReportSchedule> {