IO-1941 change owner search

This commit is contained in:
Patrick Fic
2022-06-20 10:27:22 -07:00
parent 4fad4e41c2
commit 706f300750
2 changed files with 3 additions and 3 deletions

View File

@@ -31,7 +31,7 @@ export default function OwnerFindModalContainer({
useEffect(() => {
if (modalProps.visible && owner) {
const s = OwnerNameDisplayFunction(owner);
const s = OwnerNameDisplayFunction(owner, true);
setSearchText(s.trim());
callSearchowners({ variables: { search: s.trim() } });

View File

@@ -27,7 +27,7 @@ export function OwnerNameDisplay({ bodyshop, ownerObject }) {
}`.trim();
}
export function OwnerNameDisplayFunction(ownerObject) {
export function OwnerNameDisplayFunction(ownerObject, forceFirstLast = false) {
const emptyTest =
ownerObject.ownr_fn + ownerObject.ownr_ln + ownerObject.ownr_co_nm;
@@ -36,7 +36,7 @@ export function OwnerNameDisplayFunction(ownerObject) {
const rdxStore = store.getState();
if (rdxStore.user.bodyshop.last_name_first)
if (rdxStore.user.bodyshop.last_name_first && !forceFirstLast)
return `${ownerObject.ownr_ln || ""}, ${ownerObject.ownr_fn || ""} ${
ownerObject.ownr_co_nm || ""
}`.trim();