debug: add detailed logging for company options mapping
This commit is contained in:
parent
54552b2dcd
commit
3f89edd327
1 changed files with 14 additions and 2 deletions
|
|
@ -116,13 +116,25 @@ export default function AdminJobsPage() {
|
||||||
|
|
||||||
const companyOptions = useMemo(
|
const companyOptions = useMemo(
|
||||||
() => {
|
() => {
|
||||||
const opts = companies.map((c) => ({ id: c.id, name: c.name }))
|
console.log("[DEBUG] Companies raw data:", companies)
|
||||||
console.log("[DEBUG] Company options:", opts)
|
console.log("[DEBUG] Companies length:", companies.length)
|
||||||
|
if (companies.length > 0) {
|
||||||
|
console.log("[DEBUG] First company object:", companies[0])
|
||||||
|
console.log("[DEBUG] First company keys:", Object.keys(companies[0]))
|
||||||
|
}
|
||||||
|
const opts = companies
|
||||||
|
.filter((c) => c && (c.id || c.ID))
|
||||||
|
.map((c) => ({
|
||||||
|
id: c.id || (c as unknown as { ID?: string }).ID,
|
||||||
|
name: c.name || (c as unknown as { Name?: string }).Name || "Unknown"
|
||||||
|
}))
|
||||||
|
console.log("[DEBUG] Company options mapped:", opts)
|
||||||
return opts
|
return opts
|
||||||
},
|
},
|
||||||
[companies],
|
[companies],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
const filteredJobs = useMemo(
|
const filteredJobs = useMemo(
|
||||||
() =>
|
() =>
|
||||||
jobRows.filter(
|
jobRows.filter(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue