Skip to content

Commit 50fcd41

Browse files
Orv2 3988 view company profile from staff search for permit results (#2019)
Signed-off-by: Abhishek Dere <abhishek.dere@gov.bc.ca>
1 parent 3a5b2f5 commit 50fcd41

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

frontend/src/features/idir/search/components/IDIRPermitSearchResults.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
MaterialReactTable,
1010
useMaterialReactTable,
1111
} from "material-react-table";
12-
import * as routes from "../../../../routes/constants";
1312
import OnRouteBCContext from "../../../../common/authentication/OnRouteBCContext";
1413
import { Optional } from "../../../../common/types/common";
1514
import { USER_ROLE } from "../../../../common/authentication/types";
@@ -101,9 +100,7 @@ export const IDIRPermitSearchResults = memo(
101100
const { data, isPending, isError } = searchResultsQuery;
102101

103102
const navigate = useNavigate();
104-
const { handleSelectCompany } = useSetCompanyHandler(
105-
routes.PROFILE_ROUTES.MANAGE,
106-
);
103+
const { handleSelectCompany } = useSetCompanyHandler();
107104
const fetchCompanyData = async (companyId: number) => {
108105
const searchURL = new URL(`${VEHICLES_URL}/companies/${companyId}`);
109106
searchURL.searchParams.set("page", pagination.pageIndex.toString());

frontend/src/features/idir/search/helpers/useSetCompanyHandler.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import { VerifiedClient } from "../../../../common/authentication/types";
77

88
export type CompanyOrClient = CompanyProfile | VerifiedClient;
99

10-
export const useSetCompanyHandler = (
11-
redirectRoute: string = routes.APPLICATIONS_ROUTES.BASE,
12-
) => {
10+
export const useSetCompanyHandler = () => {
1311
const navigate = useNavigate();
1412

1513
const context = useContext(OnRouteBCContext);
@@ -32,7 +30,7 @@ export const useSetCompanyHandler = (
3230
setOnRouteBCClientNumber?.(() => clientNumber);
3331
setIsCompanySuspended?.(() => isSuspended);
3432
sessionStorage.setItem("onRouteBC.user.companyId", companyId.toString());
35-
navigate(redirectRoute);
33+
navigate(routes.APPLICATIONS_ROUTES.BASE);
3634
} else {
3735
const {
3836
migratedClientHash,

0 commit comments

Comments
 (0)