fix(frontend): adjust admin jobs pagination property access
This commit is contained in:
parent
49fdcd0168
commit
48dad702d6
1 changed files with 3 additions and 3 deletions
|
|
@ -80,9 +80,9 @@ export default function AdminJobsPage() {
|
|||
// Let's assume standard response for now. If API doesn't return total, we might need a separate count call or API update.
|
||||
// Checking `adminJobsApi.list` later if issues arise. Assuming it returns `total` somewhere if needed.
|
||||
// For now preventing errors:
|
||||
if (jobsData.meta) {
|
||||
setTotalPages(jobsData.meta.last_page || Math.ceil((jobsData.meta.total || 0) / limit))
|
||||
setTotalJobs(jobsData.meta.total || 0)
|
||||
if (jobsData.pagination) {
|
||||
setTotalPages(Math.ceil((jobsData.pagination.total || 0) / limit))
|
||||
setTotalJobs(jobsData.pagination.total || 0)
|
||||
} else {
|
||||
// Fallback: simpler pagination if no meta
|
||||
setTotalPages(1)
|
||||
|
|
|
|||
Loading…
Reference in a new issue