Fixed pagination errors on the Task page, updated to the correct API calls to get that data.
This commit is contained in:
parent
59e21a51f2
commit
84c7eb0580
3 changed files with 59 additions and 81 deletions
|
|
@ -22,7 +22,7 @@ const FRAPPE_GET_JOB_TASK_LIST_METHOD = "custom_ui.api.db.jobs.get_job_task_tabl
|
|||
const FRAPPE_GET_INSTALL_PROJECTS_METHOD = "custom_ui.api.db.jobs.get_install_projects";
|
||||
const FRAPPE_GET_JOB_TEMPLATES_METHOD = "custom_ui.api.db.jobs.get_job_templates";
|
||||
// Task methods
|
||||
const FRAPPE_GET_TASKS_METHOD = "custom_ui.api.db.tasks.get_job_task_table_data";
|
||||
const FRAPPE_GET_TASKS_METHOD = "custom_ui.api.db.tasks.get_tasks_table_data";
|
||||
// Invoice methods
|
||||
const FRAPPE_GET_INVOICES_METHOD = "custom_ui.api.db.invoices.get_invoice_table_data";
|
||||
const FRAPPE_UPSERT_INVOICE_METHOD = "custom_ui.api.db.invoices.upsert_invoice";
|
||||
|
|
@ -359,20 +359,28 @@ class Api {
|
|||
const actualSortField = sorting?.field || sortField;
|
||||
const actualSortOrder = sorting?.order || sortOrder;
|
||||
|
||||
const options = {
|
||||
page: page + 1, // Backend expects 1-based pages
|
||||
page_size: pageSize,
|
||||
filters,
|
||||
sorting:
|
||||
actualSortField && actualSortOrder
|
||||
//const options = {
|
||||
// page: page + 1, // Backend expects 1-based pages
|
||||
// page_size: pageSize,
|
||||
// filters,
|
||||
// sorting:
|
||||
// actualSortField && actualSortOrder
|
||||
// ? `${actualSortField} ${actualSortOrder === -1 ? "desc" : "asc"}`
|
||||
// : null,
|
||||
// for_table: true,
|
||||
//};
|
||||
|
||||
const sortings = actualSortField && actualSortOrder
|
||||
? `${actualSortField} ${actualSortOrder === -1 ? "desc" : "asc"}`
|
||||
: null,
|
||||
for_table: true,
|
||||
};
|
||||
: null;
|
||||
console.log("DEBUG: API - Sending task options to backend:", page, pageSize, filters, sortings);
|
||||
|
||||
console.log("DEBUG: API - Sending task options to backend:", options);
|
||||
|
||||
const result = await this.request(FRAPPE_GET_TASKS_METHOD, { options });
|
||||
const result = await this.request(FRAPPE_GET_TASKS_METHOD, {
|
||||
filters,
|
||||
sorting,
|
||||
page: page + 1,
|
||||
pageSize,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue