mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-09-30 03:23:12 +00:00
fix(work-orders): satisfy technician assignment types
This commit is contained in:
parent
55b5441d71
commit
316cafccaa
3 changed files with 3 additions and 4 deletions
|
|
@ -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 || "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -173,7 +173,6 @@ export function useVendorDialogForm({
|
|||
pendingCreateCount: Object.keys(pendingCreates).length,
|
||||
},
|
||||
baseline: {
|
||||
company,
|
||||
...buildSubmitBaseline({ ...technicianKeyArgs, techPhone }),
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue