fix(types): guard prisma Company fields (isAvulso, contractedHoursPerMonth) with optional casting to accommodate outdated generated types; keep TS strict without any
This commit is contained in:
parent
c9eaee7309
commit
b4bc01bc7e
1 changed files with 7 additions and 4 deletions
|
|
@ -8,19 +8,22 @@ export const dynamic = "force-dynamic"
|
|||
|
||||
export default async function AdminCompaniesPage() {
|
||||
const companiesRaw = await prisma.company.findMany({ orderBy: { name: "asc" } })
|
||||
const companies = companiesRaw.map((c) => ({
|
||||
const companies = companiesRaw.map((c) => {
|
||||
const extra = c as unknown as { isAvulso?: boolean; contractedHoursPerMonth?: number | null }
|
||||
return {
|
||||
id: c.id,
|
||||
tenantId: c.tenantId,
|
||||
name: c.name,
|
||||
slug: c.slug,
|
||||
isAvulso: Boolean(c.isAvulso ?? false),
|
||||
contractedHoursPerMonth: c.contractedHoursPerMonth ?? null,
|
||||
isAvulso: Boolean(extra.isAvulso ?? false),
|
||||
contractedHoursPerMonth: extra.contractedHoursPerMonth ?? null,
|
||||
cnpj: c.cnpj ?? null,
|
||||
domain: c.domain ?? null,
|
||||
phone: c.phone ?? null,
|
||||
description: c.description ?? null,
|
||||
address: c.address ?? null,
|
||||
}))
|
||||
}
|
||||
})
|
||||
return (
|
||||
<AppShell
|
||||
header={
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue