updated table header names
This commit is contained in:
@@ -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
|
||||
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
|
||||
+4
-1
@@ -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
|
||||
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
|
||||
+4
-1
@@ -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
|
||||
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
|
||||
@@ -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<WithChildren> = ({children}) => {
|
||||
} = useQuery(
|
||||
`${QUERIES.USERS_LIST}-${query}`,
|
||||
() => {
|
||||
return getUsers(query)
|
||||
return getStartedUsers(query)
|
||||
},
|
||||
{cacheTime: 0, keepPreviousData: true, refetchOnWindowFocus: false}
|
||||
)
|
||||
|
||||
@@ -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<Array<User>>
|
||||
|
||||
@@ -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<UsersQueryResponse> => {
|
||||
const NEW_USER_ENDPOINT = import.meta.env.VITE_APP_USER_ENDPOINT
|
||||
|
||||
const getStartedUsers = (query: string): Promise<UsersQueryResponse> => {
|
||||
return axios
|
||||
.get(`${GET_USERS_URL}?${query}`)
|
||||
.then((d: AxiosResponse<UsersQueryResponse>) => d.data);
|
||||
};
|
||||
// const getStartedUsers = (query: string): Promise<UsersQueryResponse> => {
|
||||
// return axios
|
||||
// .get(`${NEW_USER_ENDPOINT}/loan/started`)
|
||||
// .then((d: AxiosResponse<UsersQueryResponse>) => d.data);
|
||||
// };
|
||||
|
||||
const getUserById = (id: ID): Promise<User | undefined> => {
|
||||
return axios
|
||||
@@ -43,7 +50,7 @@ const deleteSelectedUsers = (userIds: Array<ID>): Promise<void> => {
|
||||
};
|
||||
|
||||
export {
|
||||
getUsers,
|
||||
getStartedUsers,
|
||||
deleteUser,
|
||||
deleteSelectedUsers,
|
||||
getUserById,
|
||||
|
||||
@@ -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, [])
|
||||
|
||||
@@ -20,26 +20,26 @@ const usersColumns: ReadonlyArray<Column<User>> = [
|
||||
Cell: ({...props}) => <UserInfoCell user={props.data[props.row.index]} />,
|
||||
},
|
||||
{
|
||||
Header: (props) => <UserCustomHeader tableProps={props} title='Role' className='min-w-125px' />,
|
||||
Header: (props) => <UserCustomHeader tableProps={props} title='Amount' className='min-w-125px' />,
|
||||
accessor: 'role',
|
||||
},
|
||||
{
|
||||
Header: (props) => (
|
||||
<UserCustomHeader tableProps={props} title='Last login' className='min-w-125px' />
|
||||
<UserCustomHeader tableProps={props} title='Payment Terms' className='min-w-125px' />
|
||||
),
|
||||
id: 'last_login',
|
||||
Cell: ({...props}) => <UserLastLoginCell last_login={props.data[props.row.index].last_login} />,
|
||||
},
|
||||
{
|
||||
Header: (props) => (
|
||||
<UserCustomHeader tableProps={props} title='Two steps' className='min-w-125px' />
|
||||
<UserCustomHeader tableProps={props} title='Agent' className='min-w-125px' />
|
||||
),
|
||||
id: 'two_steps',
|
||||
Cell: ({...props}) => <UserTwoStepsCell two_steps={props.data[props.row.index].two_steps} />,
|
||||
},
|
||||
{
|
||||
Header: (props) => (
|
||||
<UserCustomHeader tableProps={props} title='Joined day' className='min-w-125px' />
|
||||
<UserCustomHeader tableProps={props} title='Added' className='min-w-125px' />
|
||||
),
|
||||
accessor: 'joined_day',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user