chore(root): rename organizationSlug to organizationId (#91)
This commit is contained in:
committed by
GitHub
parent
0221948aab
commit
cd16ac878d
@@ -39,7 +39,7 @@ interface Props {
|
||||
projectId: string;
|
||||
}
|
||||
export default function AddClient(props: Props) {
|
||||
const { organizationSlug, projectId } = useAppParams();
|
||||
const { organizationId, projectId } = useAppParams();
|
||||
const router = useRouter();
|
||||
const form = useForm<IForm>({
|
||||
resolver: zodResolver(validation),
|
||||
@@ -60,7 +60,7 @@ export default function AddClient(props: Props) {
|
||||
},
|
||||
});
|
||||
const query = api.project.list.useQuery({
|
||||
organizationSlug,
|
||||
organizationId,
|
||||
});
|
||||
const onSubmit: SubmitHandler<IForm> = (values) => {
|
||||
if (hasDomain && values.cors === '') {
|
||||
@@ -73,7 +73,7 @@ export default function AddClient(props: Props) {
|
||||
name: values.name,
|
||||
cors: hasDomain ? values.cors : null,
|
||||
projectId: values.projectId,
|
||||
organizationSlug,
|
||||
organizationId,
|
||||
type: values.type,
|
||||
crossDomain: values.crossDomain,
|
||||
});
|
||||
|
||||
@@ -19,7 +19,7 @@ const validator = z.object({
|
||||
type IForm = z.infer<typeof validator>;
|
||||
|
||||
export default function AddDashboard() {
|
||||
const { projectId, organizationSlug } = useAppParams();
|
||||
const { projectId, organizationId } = useAppParams();
|
||||
const router = useRouter();
|
||||
|
||||
const { register, handleSubmit, formState } = useForm<IForm>({
|
||||
@@ -32,7 +32,7 @@ export default function AddDashboard() {
|
||||
const mutation = api.dashboard.create.useMutation({
|
||||
onError: handleError,
|
||||
onSuccess(res) {
|
||||
router.push(`/${organizationSlug}/${projectId}/dashboards/${res.id}`);
|
||||
router.push(`/${organizationId}/${projectId}/dashboards/${res.id}`);
|
||||
toast('Success', {
|
||||
description: 'Dashboard created.',
|
||||
});
|
||||
|
||||
@@ -19,7 +19,7 @@ const validator = z.object({
|
||||
type IForm = z.infer<typeof validator>;
|
||||
|
||||
export default function AddProject() {
|
||||
const { organizationSlug } = useAppParams();
|
||||
const { organizationId } = useAppParams();
|
||||
const router = useRouter();
|
||||
const mutation = api.project.create.useMutation({
|
||||
onError: handleError,
|
||||
@@ -45,7 +45,7 @@ export default function AddProject() {
|
||||
onSubmit={handleSubmit((values) => {
|
||||
mutation.mutate({
|
||||
...values,
|
||||
organizationSlug,
|
||||
organizationId,
|
||||
});
|
||||
})}
|
||||
>
|
||||
|
||||
@@ -30,7 +30,7 @@ type IForm = z.infer<typeof validator>;
|
||||
|
||||
export default function SaveReport({ report }: SaveReportProps) {
|
||||
const router = useRouter();
|
||||
const { organizationSlug, projectId } = useAppParams();
|
||||
const { organizationId, projectId } = useAppParams();
|
||||
const searchParams = useSearchParams();
|
||||
const dashboardId = searchParams?.get('dashboardId') ?? undefined;
|
||||
|
||||
@@ -42,7 +42,7 @@ export default function SaveReport({ report }: SaveReportProps) {
|
||||
});
|
||||
popModal();
|
||||
router.push(
|
||||
`/${organizationSlug}/${projectId}/reports/${
|
||||
`/${organizationId}/${projectId}/reports/${
|
||||
res.id
|
||||
}?${searchParams?.toString()}`,
|
||||
);
|
||||
|
||||
@@ -20,7 +20,7 @@ const validator = zShareOverview;
|
||||
type IForm = z.infer<typeof validator>;
|
||||
|
||||
export default function ShareOverviewModal() {
|
||||
const { projectId, organizationSlug } = useAppParams();
|
||||
const { projectId, organizationId } = useAppParams();
|
||||
const router = useRouter();
|
||||
|
||||
const { register, handleSubmit, control } = useForm<IForm>({
|
||||
@@ -29,7 +29,7 @@ export default function ShareOverviewModal() {
|
||||
public: true,
|
||||
password: '',
|
||||
projectId,
|
||||
organizationSlug,
|
||||
organizationId,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user