fix(frontend): adjust admin jobs pagination property access

This commit is contained in:
Tiago Yamamoto 2025-12-24 19:53:54 -03:00
parent 49fdcd0168
commit 48dad702d6

View file

@ -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)