Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 54b550b624 | |||
| cead31a6d1 | |||
| 4508743be4 |
@@ -12,3 +12,6 @@ VITE_APP_PREVIEW_URL=https://www.digifi.com/demo1/
|
|||||||
VITE_APP_PREVIEW_REACT_URL=https://www.digifi.com
|
VITE_APP_PREVIEW_REACT_URL=https://www.digifi.com
|
||||||
VITE_APP_PREVIEW_DOCS_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
|
||||||
@@ -12,3 +12,6 @@ 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_REACT_URL=https://preview.keenthemes.com/metronic8/react
|
||||||
VITE_APP_PREVIEW_DOCS_URL=https://preview.keenthemes.com/metronic8/react/docs
|
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
|
||||||
@@ -12,3 +12,6 @@ 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_REACT_URL=https://preview.keenthemes.com/metronic8/react
|
||||||
VITE_APP_PREVIEW_DOCS_URL=https://preview.keenthemes.com/metronic8/react/docs
|
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,
|
stringifyRequestQuery,
|
||||||
WithChildren,
|
WithChildren,
|
||||||
} from '../../../../../../_digifi/helpers'
|
} from '../../../../../../_digifi/helpers'
|
||||||
import {getUsers} from './_requests'
|
import {getStartedUsers} from './_requests'
|
||||||
import {User} from './_models'
|
import {User} from './_models'
|
||||||
import {useQueryRequest} from './QueryRequestProvider'
|
import {useQueryRequest} from './QueryRequestProvider'
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ const QueryResponseProvider: FC<WithChildren> = ({children}) => {
|
|||||||
} = useQuery(
|
} = useQuery(
|
||||||
`${QUERIES.USERS_LIST}-${query}`,
|
`${QUERIES.USERS_LIST}-${query}`,
|
||||||
() => {
|
() => {
|
||||||
return getUsers(query)
|
return getStartedUsers(query)
|
||||||
},
|
},
|
||||||
{cacheTime: 0, keepPreviousData: true, refetchOnWindowFocus: false}
|
{cacheTime: 0, keepPreviousData: true, refetchOnWindowFocus: false}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ export type User = {
|
|||||||
id?: ID
|
id?: ID
|
||||||
name?: string
|
name?: string
|
||||||
avatar?: string
|
avatar?: string
|
||||||
email?: string
|
// email?: string
|
||||||
position?: string
|
position?: string
|
||||||
role?: string
|
role?: string
|
||||||
last_login?: string
|
last_login?: string
|
||||||
@@ -14,6 +14,21 @@ export type User = {
|
|||||||
label: string
|
label: string
|
||||||
state: 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>>
|
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 USER_URL = `${API_URL}/user`;
|
||||||
const GET_USERS_URL = `${API_URL}/users/query`;
|
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
|
return axios
|
||||||
.get(`${GET_USERS_URL}?${query}`)
|
.get(`${GET_USERS_URL}?${query}`)
|
||||||
.then((d: AxiosResponse<UsersQueryResponse>) => d.data);
|
.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> => {
|
const getUserById = (id: ID): Promise<User | undefined> => {
|
||||||
return axios
|
return axios
|
||||||
@@ -43,7 +50,7 @@ const deleteSelectedUsers = (userIds: Array<ID>): Promise<void> => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getUsers,
|
getStartedUsers,
|
||||||
deleteUser,
|
deleteUser,
|
||||||
deleteSelectedUsers,
|
deleteSelectedUsers,
|
||||||
getUserById,
|
getUserById,
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {KTCardBody} from '../../../../../../_digifi/helpers'
|
|||||||
|
|
||||||
const UsersTable = () => {
|
const UsersTable = () => {
|
||||||
const users = useQueryResponseData()
|
const users = useQueryResponseData()
|
||||||
|
console.log('users', users)
|
||||||
const isLoading = useQueryResponseLoading()
|
const isLoading = useQueryResponseLoading()
|
||||||
const data = useMemo(() => users, [users])
|
const data = useMemo(() => users, [users])
|
||||||
const columns = useMemo(() => usersColumns, [])
|
const columns = useMemo(() => usersColumns, [])
|
||||||
|
|||||||
@@ -20,26 +20,26 @@ const usersColumns: ReadonlyArray<Column<User>> = [
|
|||||||
Cell: ({...props}) => <UserInfoCell user={props.data[props.row.index]} />,
|
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',
|
accessor: 'role',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: (props) => (
|
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',
|
id: 'last_login',
|
||||||
Cell: ({...props}) => <UserLastLoginCell last_login={props.data[props.row.index].last_login} />,
|
Cell: ({...props}) => <UserLastLoginCell last_login={props.data[props.row.index].last_login} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: (props) => (
|
Header: (props) => (
|
||||||
<UserCustomHeader tableProps={props} title='Two steps' className='min-w-125px' />
|
<UserCustomHeader tableProps={props} title='Agent' className='min-w-125px' />
|
||||||
),
|
),
|
||||||
id: 'two_steps',
|
id: 'two_steps',
|
||||||
Cell: ({...props}) => <UserTwoStepsCell two_steps={props.data[props.row.index].two_steps} />,
|
Cell: ({...props}) => <UserTwoStepsCell two_steps={props.data[props.row.index].two_steps} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: (props) => (
|
Header: (props) => (
|
||||||
<UserCustomHeader tableProps={props} title='Joined day' className='min-w-125px' />
|
<UserCustomHeader tableProps={props} title='Added' className='min-w-125px' />
|
||||||
),
|
),
|
||||||
accessor: 'joined_day',
|
accessor: 'joined_day',
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user