Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f52e06af65 | |||
| 697a467780 | |||
| 9499422c9a | |||
| 148659b453 |
+2
-2
@@ -38,7 +38,7 @@ const editUserSchema = Yup.object().shape({
|
|||||||
|
|
||||||
const ModalForm: FC<Props> = ({ user, isUserLoading }) => {
|
const ModalForm: FC<Props> = ({ user, isUserLoading }) => {
|
||||||
|
|
||||||
const {closeCustomModal} = useCustomModal()
|
const {closeCustomModal, showCustomModal} = useCustomModal()
|
||||||
|
|
||||||
const { setItemIdForUpdate } = useListView();
|
const { setItemIdForUpdate } = useListView();
|
||||||
const { refetch, isLoading } = useQueryResponse();
|
const { refetch, isLoading } = useQueryResponse();
|
||||||
@@ -72,7 +72,7 @@ const ModalForm: FC<Props> = ({ user, isUserLoading }) => {
|
|||||||
if (isNotEmpty(values.id)) {
|
if (isNotEmpty(values.id)) {
|
||||||
await updateUser(values);
|
await updateUser(values);
|
||||||
} else {
|
} else {
|
||||||
await createSignatory(values);
|
await createSignatory({employer_uid:showCustomModal?.data?.id, ...values});
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
console.error(ex);
|
console.error(ex);
|
||||||
|
|||||||
+1
-1
@@ -61,7 +61,7 @@ const UserActionsCell: FC<Props> = ({id}) => {
|
|||||||
|
|
||||||
{/* begin::Menu item */}
|
{/* begin::Menu item */}
|
||||||
<div className='menu-item px-3'>
|
<div className='menu-item px-3'>
|
||||||
<a className='menu-link px-3' onClick={()=>{openCustomModal(MODALNAMES.addSignatory, {})}}>
|
<a className='menu-link px-3' onClick={()=>{openCustomModal(MODALNAMES.addSignatory, {id})}}>
|
||||||
Add Signatory
|
Add Signatory
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const getApprovedUsers = (query: string): Promise<UsersQueryResponse> => { // FU
|
|||||||
};
|
};
|
||||||
|
|
||||||
const employersVerify = (uid: ID): Promise<UsersQueryResponse> => { // FUNCTION FOR EMPLOYERS VERIFICATION
|
const employersVerify = (uid: ID): Promise<UsersQueryResponse> => { // FUNCTION FOR EMPLOYERS VERIFICATION
|
||||||
return postAuxEnd('/employers/verify', {employer_uid:uid})
|
return postAuxEnd('/employers/verify', {application_uid:uid})
|
||||||
};
|
};
|
||||||
|
|
||||||
const getUserById = (id: ID): Promise<User | undefined> => {
|
const getUserById = (id: ID): Promise<User | undefined> => {
|
||||||
|
|||||||
@@ -9,15 +9,14 @@ import { User } from "../../../core/_models";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
id: ID;
|
id: ID;
|
||||||
data?: Array<User> | any
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const UserActionsCell: FC<Props> = ({ id, data }) => {
|
const UserActionsCell: FC<Props> = ({ id }) => {
|
||||||
const { setItemIdForUpdate } = useListView();
|
const { setItemIdForUpdate } = useListView();
|
||||||
const { query } = useQueryResponse();
|
const { query } = useQueryResponse();
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
let selectedUser = data?.filter((item:User) => item.uid == id)[0]
|
// let selectedUser = data?.filter((item:User) => item.uid == id)[0]
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
MenuComponent.reinitialization();
|
MenuComponent.reinitialization();
|
||||||
@@ -27,7 +26,7 @@ const UserActionsCell: FC<Props> = ({ id, data }) => {
|
|||||||
setItemIdForUpdate(id);
|
setItemIdForUpdate(id);
|
||||||
};
|
};
|
||||||
|
|
||||||
const empsVerify = useMutation(() => employersVerify(selectedUser?.employer_uid), {
|
const empsVerify = useMutation(() => employersVerify(id), {
|
||||||
// 💡 response of the mutation is passed to onSuccess
|
// 💡 response of the mutation is passed to onSuccess
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
// ✅ update detail view directly
|
// ✅ update detail view directly
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ const usersColumns: ReadonlyArray<Column<User>> = [
|
|||||||
<UserCustomHeader tableProps={props} title='Actions' className='text-end min-w-100px' />
|
<UserCustomHeader tableProps={props} title='Actions' className='text-end min-w-100px' />
|
||||||
),
|
),
|
||||||
id: 'actions',
|
id: 'actions',
|
||||||
Cell: ({...props}) => <UserActionsCell id={props.data[props.row.index].uid} data={props?.data} />,
|
Cell: ({...props}) => <UserActionsCell id={props.data[props.row.index].uid} />,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ type ContextProps = {
|
|||||||
type ShowModalProps = {
|
type ShowModalProps = {
|
||||||
name?: string
|
name?: string
|
||||||
data?: {
|
data?: {
|
||||||
[index: string]: string | number | undefined;
|
[index: string]: undefined | null | number | string;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type DataProps = {
|
type DataProps = {
|
||||||
[index: string]: string | number | undefined;
|
[index: string]: undefined | null | number | string;
|
||||||
}
|
}
|
||||||
|
|
||||||
type ModalNames = {
|
type ModalNames = {
|
||||||
|
|||||||
Reference in New Issue
Block a user