Skip to content

Commit e423160

Browse files
committed
chore: small fix
Signed-off-by: samuel.park <[email protected]>
1 parent 47e6732 commit e423160

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: apps/web/src/services/project/v2/components/ProjectDashboardCloneModal.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { getClonedName } from '@cloudforet/utils';
99
1010
import { RESOURCE_GROUP } from '@/api-clients/_common/schema/constant';
1111
import type { DashboardCreateParams, DashboardModel } from '@/api-clients/dashboard/_types/dashboard-type';
12+
import type { PublicDashboardModel } from '@/api-clients/dashboard/public-dashboard/schema/model';
1213
import { i18n } from '@/translations';
1314
1415
import { showErrorMessage } from '@/lib/helper/notice-alert-helper';
@@ -38,7 +39,7 @@ const { projectGroupId, projectId } = useProjectOrGroupId(projectGroupOrProjectI
3839
const {
3940
dashboardList,
4041
dashboardSharedList,
41-
invalidateAllQueries: invalidateDashboardList,
42+
setQueryData,
4243
} = useProjectDashboardQuery({
4344
projectId,
4445
projectGroupId,
@@ -94,7 +95,7 @@ const handleConfirm = async () => {
9495
const { mutate, isPending: dashboardCloneLoading } = useDashboardCloneAction({
9596
dashboardId,
9697
onSuccess: async (data: DashboardModel) => {
97-
invalidateDashboardList();
98+
setQueryData([data as PublicDashboardModel]);
9899
projectPageModalStore.closeDashboardCloneModal();
99100
await router.replace({
100101
name: PROJECT_ROUTE_V2._NAME,

Diff for: apps/web/src/services/project/v2/composables/queries/use-project-dashboard-query.ts

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export const useProjectDashboardQuery = (options: {
4747
{ k: 'scope', v: 'PROJECT', o: 'eq' },
4848
{ k: 'shared', v: true, o: 'eq' },
4949
],
50+
sort: [{ key: 'created_at', desc: false }],
5051
},
5152
})),
5253
});
@@ -59,6 +60,7 @@ export const useProjectDashboardQuery = (options: {
5960
filter: [
6061
{ k: 'version', v: '1.0', o: 'not' },
6162
],
63+
sort: [{ key: 'created_at', desc: false }],
6264
},
6365
})),
6466
});

0 commit comments

Comments
 (0)