diff --git a/frontend/src/api.js b/frontend/src/api.js index 089d80f..a10fee6 100644 --- a/frontend/src/api.js +++ b/frontend/src/api.js @@ -178,10 +178,6 @@ class Api { } static async getJobDetails() { - //const data = DataUtils.dummyJobData.map((job) => ({ - // ...job, - // stepProgress: DataUtils.calculateStepProgress(job.steps), - //})); const projects = await this.getDocsList("Project"); const data = []; for (let prj of projects) { @@ -207,6 +203,14 @@ class Api { static async getRouteData() { const data = DataUtils.dummyRouteData; + //const data = []; + const routes = getDocList("Pre-Built Routes"); + for (const rt of routes) { + route = getDetailedDoc("Pre-Built Routes", rt.name); + let tableRow = { + }; + } + console.log("DEBUG: API - getRouteData result: ", data); return data; } @@ -218,7 +222,22 @@ class Api { } static async getTimesheetData() { - const data = DataUtils.dummyTimesheetData; + //const data = DataUtils.dummyTimesheetData; + const data = []; + const timesheets = await this.getDocsList("Timesheet"); + for (const ts of timesheets) { + const timesheet = await this.getDetailedDoc("Timesheet", ts.name); + const tableRow = { + timesheetId: timesheet.name, + employee: timesheet.employee_name, + date: timesheet.date, + customer: timesheet.customer, + totalHours: timesheet.total_hours, + status: timesheet.status, + totalPayFormatted: timesheet.total_costing_amount + } + data.push(tableRow); + } console.log("DEBUG: API - getTimesheetData result: ", data); return data; }