fix(machines): guard Convex getById calls with 'skip' when missing id to avoid ArgumentValidationError; add unit test for getById metadata; fix build by loosening Prisma types in company service
This commit is contained in:
parent
5ff37195f5
commit
49173cdf69
6 changed files with 110 additions and 18 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)
|
||||
const createData = buildCompanyData(form, existing.tenantId) as any
|
||||
const { tenantId: _omitTenant, ...updateData } = createData
|
||||
void _omitTenant
|
||||
|
||||
const company = await prisma.company.update({
|
||||
where: { id },
|
||||
data: updateData,
|
||||
data: updateData as any,
|
||||
})
|
||||
|
||||
if (company.provisioningCode) {
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ export async function POST(request: Request) {
|
|||
|
||||
const company = await prisma.company.create({
|
||||
data: {
|
||||
...buildCompanyData(form, tenantId),
|
||||
...(buildCompanyData(form, tenantId) as any),
|
||||
provisioningCode,
|
||||
},
|
||||
} as any,
|
||||
})
|
||||
|
||||
if (company.provisioningCode) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue