CFE-3 bringing all directories and finish test of DataTable index and start CreatForm test
This commit is contained in:
@@ -42,13 +42,11 @@ function DataTable(props) {
|
||||
const [updateTime, setupdateTime] = useState(
|
||||
moment().format("HH:mm | jYYYY/jM/jD")
|
||||
);
|
||||
|
||||
const tableLocalization = useMemo(
|
||||
() =>
|
||||
languageList.find((item) => item.key == languageApp).tableLocalization,
|
||||
[languageApp, languageList]
|
||||
);
|
||||
|
||||
const fetchUrl = useMemo(() => {
|
||||
const url = new URL(props.tableUrl);
|
||||
url.searchParams.set(
|
||||
@@ -73,12 +71,10 @@ function DataTable(props) {
|
||||
url.searchParams.set("sorting", JSON.stringify(sorting ?? []));
|
||||
return url;
|
||||
}, [
|
||||
props.tableUrl,
|
||||
columnFilters,
|
||||
columnFilterFns,
|
||||
pagination,
|
||||
sorting,
|
||||
props.columns,
|
||||
]);
|
||||
|
||||
const {data, isValidating, mutate} = useSWR(fetchUrl, fetcher, {
|
||||
@@ -91,6 +87,7 @@ function DataTable(props) {
|
||||
setupdateTime(moment().format("HH:mm | jYYYY/jM/jD"));
|
||||
}, [isValidating, languageApp]);
|
||||
|
||||
|
||||
return (
|
||||
<MaterialReactTable
|
||||
localization={tableLocalization}
|
||||
@@ -134,8 +131,8 @@ function DataTable(props) {
|
||||
renderTopToolbarCustomActions={({table}) => (
|
||||
<>
|
||||
{props.enableCustomToolbar /* send condition */
|
||||
? props.CustomToolbar /* send component */
|
||||
: ""}
|
||||
? (<props.CustomToolbar fetchUrl={fetchUrl} mutate={mutate}/>) /* send component */
|
||||
: <span></span>}
|
||||
</>
|
||||
)}
|
||||
renderBottomToolbarCustomActions={({table}) => (
|
||||
@@ -159,7 +156,6 @@ function DataTable(props) {
|
||||
</>
|
||||
)}
|
||||
state={{
|
||||
isLoading: isValidating,
|
||||
columnFilters,
|
||||
columnFilterFns,
|
||||
pagination,
|
||||
|
||||
@@ -10,4 +10,8 @@ export const SET_USER_PASSWORD = BASE_URL + "/dashboard/profile/change_password"
|
||||
|
||||
//user data
|
||||
export const GET_USER_ROUTE = BASE_URL + "/dashboard/profile/info";
|
||||
//user data
|
||||
//user data
|
||||
|
||||
//expert management
|
||||
export const GET_EXPERT_MANAGEMENT_LIST = BASE_URL + "/dashboard/experts/show";
|
||||
//expert management
|
||||
Reference in New Issue
Block a user