fix(work-orders): satisfy technician assignment types

This commit is contained in:
Alexandre Brandizzi 2026-09-29 19:30:48 -03:00
parent 55b5441d71
commit 316cafccaa
3 changed files with 3 additions and 4 deletions

View file

@ -34,7 +34,7 @@ type UseCompDocDialogArgs = {
function completionDocTechnician(
assigned: boolean | null | undefined,
frozenAssigned: boolean | null | undefined,
contactName: string,
contactName: string | undefined,
): string {
return assigned === false || frozenAssigned === false ? "" : contactName || "";
}

View file

@ -173,7 +173,6 @@ export function useVendorDialogForm({
pendingCreateCount: Object.keys(pendingCreates).length,
},
baseline: {
company,
...buildSubmitBaseline({ ...technicianKeyArgs, techPhone }),
},
});

View file

@ -48,7 +48,7 @@ async function resolvePersistedVendor(args: {
phone: string;
addTechnicians: ReturnType<typeof useAddTechniciansToCompany>;
setSaveError: (error: string | null) => void;
}): Promise<VendorDropdownItem | null> {
}): Promise<VendorDropdownItem | undefined | null> {
const payload = args.vendor ? args.pendingCreates[String(args.vendor.id)] : undefined;
if (!args.vendor || !isDraftVendorId(args.vendor.id) || !payload) return args.vendor;
try {
@ -71,7 +71,7 @@ function resolveVendorForSave(args: {
phone: string;
addTechnicians: ReturnType<typeof useAddTechniciansToCompany>;
setSaveError: (error: string | null) => void;
}): VendorDropdownItem | undefined | Promise<VendorDropdownItem | null> {
}): VendorDropdownItem | undefined | Promise<VendorDropdownItem | undefined | null> {
const payload = args.vendor ? args.pendingCreates[String(args.vendor.id)] : undefined;
if (!args.vendor || !isDraftVendorId(args.vendor.id) || !payload) return args.vendor;
return resolvePersistedVendor(args);