Skip to content

Commit

Permalink
feat(app/worker/jobs): fix oracles dto and jobs pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
KacperKoza343 committed Jun 27, 2024
1 parent 17b1621 commit c5d75ad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ export async function getOracles({
}: {
selected_job_types: string[];
}) {
return apiClient(
`${apiPaths.worker.oracles.path}?${stringifyUrlQueryObject({ selected_job_types: selected_job_types.join(',') })}`,
{
successSchema: OraclesSuccessSchema,
options: { method: 'GET' },
}
);
const queryParams = selected_job_types.length
? `?${stringifyUrlQueryObject({ selected_job_types: selected_job_types.join(',') })}`
: '';

return apiClient(`${apiPaths.worker.oracles.path}${queryParams}`, {
successSchema: OraclesSuccessSchema,
options: { method: 'GET' },
});
}

export function useGetOracles() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export function AvailableJobsTable() {
showProgressBars: tableStatus === 'pending' || isAssignJobMutationPending,
pagination: paginationState,
},
enablePagination: true,
enablePagination: Boolean(tableData?.total_pages),
manualPagination: true,
onPaginationChange: setPaginationState,
muiPaginationProps: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export function MyJobsTable() {
showProgressBars: tableStatus === 'pending',
pagination: paginationState,
},
enablePagination: true,
enablePagination: Boolean(tableData?.total_pages),
manualPagination: true,
onPaginationChange: (updater) => {
setPaginationState(updater);
Expand Down

0 comments on commit c5d75ad

Please sign in to comment.