CUB-129: fix lint warning in useMemo and add typescript-eslint dev dep
Dev Build / build-test (pull_request) Successful in 2m58s
Dev Build / build-test (pull_request) Successful in 2m58s
This commit is contained in:
@@ -71,20 +71,20 @@ export default function PrintJobsPage() {
|
||||
queryFn: () => fetchPrintJobs(filter),
|
||||
})
|
||||
|
||||
const jobs = data?.data ?? []
|
||||
const total = data?.total ?? 0
|
||||
const totalPages = Math.max(1, Math.ceil(total / PAGE_SIZE))
|
||||
|
||||
// Client-side search (name + printer name)
|
||||
const filtered = useMemo(() => {
|
||||
if (!search.trim()) return jobs
|
||||
const jobList = data?.data ?? []
|
||||
if (!search.trim()) return jobList
|
||||
const q = search.toLowerCase()
|
||||
return jobs.filter(
|
||||
return jobList.filter(
|
||||
(j: PrintJob) =>
|
||||
j.name.toLowerCase().includes(q) ||
|
||||
j.printer_name.toLowerCase().includes(q)
|
||||
)
|
||||
}, [jobs, search])
|
||||
}, [data?.data, search])
|
||||
|
||||
const handleSort = (field: SortField) => {
|
||||
if (sortBy === field) {
|
||||
|
||||
Reference in New Issue
Block a user