formatting

This commit is contained in:
Amirhossein Mahmoodi
2024-08-18 11:11:58 +03:30
parent f7c93d0404
commit f2e199ee8a
40 changed files with 733 additions and 450 deletions

View File

@@ -23,7 +23,7 @@ const DataTableProvider = ({ children, user_id, page_name, table_name, columns }
const filterValues = flatColumns.reduce((acc, column) => {
if (!column.enableColumnFilter) return acc;
const storeFilter = settingStore?.[user_id]?.[page_name]?.[table_name]?.["filters"]?.find(
(filter) => filter.id === column.id,
(filter) => filter.id === column.id
);
if (column.datatype === "array") {
acc[column.id] = {
@@ -100,7 +100,7 @@ const DataTableProvider = ({ children, user_id, page_name, table_name, columns }
position: "bottom-left",
draggable: true,
autoClose: false,
},
}
);
} else {
toast.update("keep_data", {

View File

@@ -49,7 +49,7 @@ export const AuthProvider = ({ children }) => {
clearUser();
changeAuthState(false);
changeInitAuth(true);
}
};
const getUser = useCallback(async () => {
try {
@@ -77,7 +77,7 @@ export const AuthProvider = ({ children }) => {
isAuth: state.isAuth,
initAuthState: state.initAuthState,
getUser,
logout
logout,
}}
>
{children}

View File

@@ -130,4 +130,4 @@ export const TableSettingProvider = ({ children }) => {
{children}
</TableSettingContext.Provider>
);
};
};

View File

@@ -16,7 +16,7 @@ const defaultOptions = {
};
const useRequest = (initOptions) => {
const { logout } = useAuth()
const { logout } = useAuth();
const _options = Object.assign({}, defaultOptions, initOptions);
@@ -38,7 +38,8 @@ const useRequest = (initOptions) => {
errorResponse(
error.response,
mergedOptions.notification.show && mergedOptions.notification.failed,
"request_data", logout
"request_data",
logout
);
}
throw error;