Signed-off-by: Bryan Frimin <bryan@getprobo.com> Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
10 lines
286 B
TypeScript
10 lines
286 B
TypeScript
import { useParams } from "react-router";
|
|
|
|
export function useOrganizationId(): string {
|
|
const { organizationId } = useParams<{ organizationId?: string }>();
|
|
if (!organizationId) {
|
|
throw new Error("Cannot resolve organizationId in route params");
|
|
}
|
|
return organizationId;
|
|
}
|