diff --git a/.env b/.env index d14a117..13900d9 100644 --- a/.env +++ b/.env @@ -11,4 +11,7 @@ VITE_APP_PURCHASE_URL=https://www.digifi.com/ VITE_APP_PREVIEW_URL=https://www.digifi.com/demo1/ VITE_APP_PREVIEW_REACT_URL=https://www.digifi.com VITE_APP_PREVIEW_DOCS_URL=https://www.digifi.com/ -VITE_APP_THEME_API_URL=https://api.digifi/api/api \ No newline at end of file +VITE_APP_THEME_API_URL=https://api.digifi/api/api + +# CUSTOM ENV VARIABLES ADDED +VITE_APP_USER_ENDPOINT=https://digifi-apidev.chiefsoft.net/digibko/v1 \ No newline at end of file diff --git a/.env.development b/.env.development index aa5351f..2d2d556 100644 --- a/.env.development +++ b/.env.development @@ -11,4 +11,7 @@ VITE_APP_PURCHASE_URL=https://themeforest.net/item/metronic-responsive-admin-das VITE_APP_PREVIEW_URL=https://preview.keenthemes.com/metronic8/react/demo1/ VITE_APP_PREVIEW_REACT_URL=https://preview.keenthemes.com/metronic8/react VITE_APP_PREVIEW_DOCS_URL=https://preview.keenthemes.com/metronic8/react/docs -VITE_APP_THEME_API_URL=https://preview.keenthemes.com/theme-api/api \ No newline at end of file +VITE_APP_THEME_API_URL=https://preview.keenthemes.com/theme-api/api + +# CUSTOM ENV VARIABLES ADDED +VITE_APP_USER_ENDPOINT=https://digifi-apidev.chiefsoft.net/digibko/v1 \ No newline at end of file diff --git a/.env.production b/.env.production index 5ce660f..3f9a1d0 100644 --- a/.env.production +++ b/.env.production @@ -11,4 +11,7 @@ VITE_APP_PURCHASE_URL=https://themeforest.net/item/metronic-responsive-admin-das VITE_APP_PREVIEW_URL=https://preview.keenthemes.com/metronic8/react/demo1/ VITE_APP_PREVIEW_REACT_URL=https://preview.keenthemes.com/metronic8/react VITE_APP_PREVIEW_DOCS_URL=https://preview.keenthemes.com/metronic8/react/docs -VITE_APP_THEME_API_URL=https://preview.keenthemes.com/theme-api/api \ No newline at end of file +VITE_APP_THEME_API_URL=https://preview.keenthemes.com/theme-api/api + +# CUSTOM ENV VARIABLES ADDED +VITE_APP_USER_ENDPOINT=https://digifi-apidev.chiefsoft.net/digibko/v1 \ No newline at end of file diff --git a/src/app/modules/apps/user-management/users-list/core/QueryResponseProvider.tsx b/src/app/modules/apps/user-management/users-list/core/QueryResponseProvider.tsx index bc7b550..98e2213 100644 --- a/src/app/modules/apps/user-management/users-list/core/QueryResponseProvider.tsx +++ b/src/app/modules/apps/user-management/users-list/core/QueryResponseProvider.tsx @@ -11,7 +11,7 @@ import { stringifyRequestQuery, WithChildren, } from '../../../../../../_digifi/helpers' -import {getUsers} from './_requests' +import {getStartedUsers} from './_requests' import {User} from './_models' import {useQueryRequest} from './QueryRequestProvider' @@ -34,7 +34,7 @@ const QueryResponseProvider: FC = ({children}) => { } = useQuery( `${QUERIES.USERS_LIST}-${query}`, () => { - return getUsers(query) + return getStartedUsers(query) }, {cacheTime: 0, keepPreviousData: true, refetchOnWindowFocus: false} ) diff --git a/src/app/modules/apps/user-management/users-list/core/_models.ts b/src/app/modules/apps/user-management/users-list/core/_models.ts index 09b4433..b9b06ec 100644 --- a/src/app/modules/apps/user-management/users-list/core/_models.ts +++ b/src/app/modules/apps/user-management/users-list/core/_models.ts @@ -3,7 +3,7 @@ export type User = { id?: ID name?: string avatar?: string - email?: string + // email?: string position?: string role?: string last_login?: string @@ -14,6 +14,21 @@ export type User = { label: string state: string } + firstname?: string, + lastname?: string + uid?: string + loan_amount?: string + payment_month?: string + sales_agent?: string + gender?: string | null + marital_status?: string + email?: string + address?: string + state?: string + country?: string + status?: string + added?: string + updated?: string } export type UsersQueryResponse = Response> diff --git a/src/app/modules/apps/user-management/users-list/core/_requests.ts b/src/app/modules/apps/user-management/users-list/core/_requests.ts index 04ae317..56269a5 100644 --- a/src/app/modules/apps/user-management/users-list/core/_requests.ts +++ b/src/app/modules/apps/user-management/users-list/core/_requests.ts @@ -6,11 +6,18 @@ const API_URL = import.meta.env.VITE_APP_THEME_API_URL; const USER_URL = `${API_URL}/user`; const GET_USERS_URL = `${API_URL}/users/query`; -const getUsers = (query: string): Promise => { +const NEW_USER_ENDPOINT = import.meta.env.VITE_APP_USER_ENDPOINT + +const getStartedUsers = (query: string): Promise => { return axios .get(`${GET_USERS_URL}?${query}`) .then((d: AxiosResponse) => d.data); }; +// const getStartedUsers = (query: string): Promise => { +// return axios +// .get(`${NEW_USER_ENDPOINT}/loan/started`) +// .then((d: AxiosResponse) => d.data); +// }; const getUserById = (id: ID): Promise => { return axios @@ -43,7 +50,7 @@ const deleteSelectedUsers = (userIds: Array): Promise => { }; export { - getUsers, + getStartedUsers, deleteUser, deleteSelectedUsers, getUserById, diff --git a/src/app/modules/apps/user-management/users-list/table/UsersTable.tsx b/src/app/modules/apps/user-management/users-list/table/UsersTable.tsx index bef3d89..5898f4c 100644 --- a/src/app/modules/apps/user-management/users-list/table/UsersTable.tsx +++ b/src/app/modules/apps/user-management/users-list/table/UsersTable.tsx @@ -11,6 +11,7 @@ import {KTCardBody} from '../../../../../../_digifi/helpers' const UsersTable = () => { const users = useQueryResponseData() + console.log('users', users) const isLoading = useQueryResponseLoading() const data = useMemo(() => users, [users]) const columns = useMemo(() => usersColumns, []) diff --git a/src/app/modules/apps/user-management/users-list/table/columns/_columns.tsx b/src/app/modules/apps/user-management/users-list/table/columns/_columns.tsx index 7b1c8db..13821a4 100644 --- a/src/app/modules/apps/user-management/users-list/table/columns/_columns.tsx +++ b/src/app/modules/apps/user-management/users-list/table/columns/_columns.tsx @@ -20,26 +20,26 @@ const usersColumns: ReadonlyArray> = [ Cell: ({...props}) => , }, { - Header: (props) => , + Header: (props) => , accessor: 'role', }, { Header: (props) => ( - + ), id: 'last_login', Cell: ({...props}) => , }, { Header: (props) => ( - + ), id: 'two_steps', Cell: ({...props}) => , }, { Header: (props) => ( - + ), accessor: 'joined_day', },