chore(types): remove anys and harden Convex data fetch
- Strongly type company-service and API routes - Fix Next.js searchParams (promise) in admin/machines page - Add vitest module marker + stub for tsconfig-paths/register - Use Convex query in client as primary fallback for machine details - Replace any casts in admin machines components Build + lint are clean locally; details page no longer skeleton-loops.
This commit is contained in:
parent
eee0f432e7
commit
c640e288b1
8 changed files with 76 additions and 90 deletions
|
|
@ -87,13 +87,13 @@ export async function PATCH(
|
|||
|
||||
const mergedInput = mergePayload(baseForm, rawBody)
|
||||
const form = sanitizeCompanyInput(mergedInput, existing.tenantId)
|
||||
const createData = buildCompanyData(form, existing.tenantId) as any
|
||||
const createData = buildCompanyData(form, existing.tenantId)
|
||||
const { tenantId: _omitTenant, ...updateData } = createData
|
||||
void _omitTenant
|
||||
|
||||
const company = await prisma.company.update({
|
||||
where: { id },
|
||||
data: updateData as any,
|
||||
data: updateData,
|
||||
})
|
||||
|
||||
if (company.provisioningCode) {
|
||||
|
|
|
|||
|
|
@ -41,11 +41,13 @@ export async function POST(request: Request) {
|
|||
const form = sanitizeCompanyInput(rawBody, tenantId)
|
||||
const provisioningCode = randomBytes(32).toString("hex")
|
||||
|
||||
const createData = buildCompanyData(form, tenantId)
|
||||
|
||||
const company = await prisma.company.create({
|
||||
data: {
|
||||
...(buildCompanyData(form, tenantId) as any),
|
||||
...createData,
|
||||
provisioningCode,
|
||||
} as any,
|
||||
},
|
||||
})
|
||||
|
||||
if (company.provisioningCode) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue