Skip to content

Commit baed7ca

Browse files
feat: Clear the entities details on selection
1 parent 4099952 commit baed7ca

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

next-env.d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

src/frontend/views/entity/Crud/index.tsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { Tabs, SectionBox } from "@adminator/chromista";
22
import noop from "lodash/noop";
33
import { useEffect, useState } from "react";
4-
import { ENTITY_TABLE_PATH } from "frontend/hooks/data/data.store";
4+
import {
5+
ENTITY_LIST_PATH,
6+
ENTITY_TABLE_PATH,
7+
} from "frontend/hooks/data/data.store";
58
import { SLUG_LOADING_VALUE, useRouteParam } from "@adminator/protozoa";
69
import { IEntityCrudSettings } from "shared/configuration.constants";
710
import { useSetPageDetails, useChangeRouterParam } from "frontend/lib/routing";
@@ -63,7 +66,12 @@ function useEntityCrudView() {
6366

6467
const upsertDetailsColumnsMutation = useUpsertConfigurationMutation(
6568
"hidden_entity_details_columns",
66-
entity
69+
entity,
70+
{
71+
/* This is an hack for ENTITY_DETAILS_PATH(entity, id) to clear all details
72+
and it quite necessary for the detail page */
73+
otherEndpoints: [ENTITY_LIST_PATH(entity)],
74+
}
6775
);
6876

6977
const upsertCrudSettingsMutation = useUpsertConfigurationMutation(

0 commit comments

Comments
 (0)