rename organizationId -> organizationSlug

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-04-08 21:49:00 +02:00
parent 097ea18320
commit 19b0e509e0
37 changed files with 109 additions and 128 deletions

View File

@@ -1,16 +1,19 @@
import { useParams } from 'next/navigation';
// eslint-disable-next-line
type AppParams = {
type AppParamsIn = {
organizationId: string;
projectId: string;
};
type AppParamsOut = {
organizationSlug: string;
projectId: string;
};
export function useAppParams<T>() {
const params = useParams<T & AppParams>();
const params = useParams<T & AppParamsIn>();
return {
...(params ?? {}),
organizationId: params?.organizationId,
organizationSlug: params?.organizationId,
projectId: params?.projectId,
} as T & AppParams;
} as T & AppParamsOut;
}