19 lines
483 B
TypeScript
19 lines
483 B
TypeScript
import { useUrlParamId } from "@erp/core/hooks";
|
|
import { useSearchParams } from "react-router-dom";
|
|
|
|
import { useCustomerViewController } from "./use-customer-view.controller";
|
|
|
|
export function useCustomerViewPageController() {
|
|
const customerId = useUrlParamId();
|
|
const [searchParams] = useSearchParams();
|
|
|
|
const viewCtrl = useCustomerViewController(customerId);
|
|
|
|
const returnTo = searchParams.get("returnTo") ?? "/customers";
|
|
|
|
return {
|
|
viewCtrl,
|
|
returnTo,
|
|
};
|
|
}
|