Skip to content

Commit 58d7d81

Browse files
committed
update the path and fix usecase id's
1 parent 3824d37 commit 58d7d81

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

app/[locale]/dashboard/[entityType]/[entitySlug]/usecases/edit/[id]/assign/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const Assign = () => {
113113
AssignUsecaseDatasets,
114114
{},
115115
{
116-
useCaseId: +params.id,
116+
useCaseId: params.id,
117117
datasetIds: Array.isArray(selectedRow)
118118
? selectedRow.map((row: any) => row.id)
119119
: [],
@@ -123,7 +123,7 @@ const Assign = () => {
123123
onSuccess: (data: any) => {
124124
toast('Dataset Assigned Successfully');
125125
UseCaseDetails.refetch();
126-
router.push(`/manage/usecases/edit/${params.id}/publish`);
126+
router.push(`/dashboard/${params.entityType}/${params.entitySlug}/usecases/edit/${params.id}/publish`);
127127
},
128128
onError: (err: any) => {
129129
toast(`Received ${err} on dataset publish `);

app/[locale]/dashboard/[entityType]/[entitySlug]/usecases/edit/[id]/publish/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ const Publish = () => {
8484
const router = useRouter();
8585

8686
const { mutate, isLoading: mutationLoading } = useMutation(
87-
() => GraphQL(publishUseCaseMutation, {}, { useCaseId: +params.id }),
87+
() => GraphQL(publishUseCaseMutation, {}, { useCaseId: params.id }),
8888
{
8989
onSuccess: (data: any) => {
9090
toast('UseCase Published Successfully');
91-
router.push(`/manage/usecases`);
91+
router.push(`/dashboard/${params.entityType}/${params.entitySlug}/usecases`);
9292
},
9393
onError: (err: any) => {
9494
toast(`Received ${err} on dataset publish `);
@@ -147,7 +147,7 @@ const Publish = () => {
147147
return {
148148
title: item.title,
149149
id: item.id,
150-
category: item.sectors[0]?.name,
150+
sector: item.sectors[0]?.name,
151151
modified: formatDate(item.modified),
152152
};
153153
});

app/[locale]/dashboard/[entityType]/[entitySlug]/usecases/edit/layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ const EditUseCase = ({ children }: LayoutProps) => {
2222
const links = [
2323
{
2424
label: 'Details',
25-
url: `/manage/usecases/edit/${params.id}/details`,
25+
url: `/dashboard/${params.entityType}/${params.entitySlug}/usecases/edit/${params.id}/details`,
2626
selected: pathItem === 'details',
2727
},
2828
{
2929
label: 'Assign',
30-
url: `/manage/usecases/edit/${params.id}/assign`,
30+
url: `/dashboard/${params.entityType}/${params.entitySlug}/usecases/edit/${params.id}/assign`,
3131
selected: pathItem === 'assign',
3232
},
3333
{
3434
label: 'Publish',
35-
url: `/manage/usecases/edit/${params.id}/publish`,
35+
url: `/dashboard/${params.entityType}/${params.entitySlug}/usecases/edit/${params.id}/publish`,
3636
selected: pathItem === 'publish',
3737
},
3838
];

app/[locale]/dashboard/[entityType]/[entitySlug]/usecases/page.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ import { GraphQL } from '@/lib/api';
1212
import { Icons } from '@/components/icons';
1313
import { LinkButton } from '@/components/Link';
1414
import { Loading } from '@/components/loading';
15-
import { Navigation } from '../dataset/components/navigate-org-datasets';
1615
import { ActionBar } from '../dataset/components/action-bar';
17-
16+
import { Navigation } from '../dataset/components/navigate-org-datasets';
1817

1918
const allUseCases: any = graphql(`
2019
query UseCasesData($filters: UseCaseFilter, $order: UseCaseOrder) {
@@ -48,7 +47,7 @@ const AddUseCase: any = graphql(`
4847
export default function DatasetPage({
4948
params,
5049
}: {
51-
params: { organizationId: string };
50+
params: { entityType: string; entitySlug: string };
5251
}) {
5352
const router = useRouter();
5453

@@ -118,7 +117,7 @@ export default function DatasetPage({
118117
} = useMutation([`delete_Usecase`], () => GraphQL(AddUseCase, {}, []), {
119118
onSuccess: (response: any) => {
120119
toast(`UseCase created successfully`);
121-
router.push(`/manage/usecases/edit/${response.addUseCase.id}/details`);
120+
router.push(`/dashboard/${params.entityType}/${params.entitySlug}/usecases/edit/${response.addUseCase.id}/details`);
122121
AllUseCases.refetch();
123122
},
124123
onError: (err: any) => {
@@ -134,7 +133,7 @@ export default function DatasetPage({
134133
<LinkButton
135134
kind="tertiary"
136135
size="medium"
137-
href={`/manage/usecases/edit/${row.original.id}/details`}
136+
href={`/dashboard/${params.entityType}/${params.entitySlug}/usecases/edit/${row.original.id}/details`}
138137
>
139138
{row.original.title}
140139
</LinkButton>

0 commit comments

Comments
 (0)