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 {closeCustomModal} = useCustomModal()
|
||||
const {closeCustomModal, showCustomModal} = useCustomModal()
|
||||
|
||||
const { setItemIdForUpdate } = useListView();
|
||||
const { refetch, isLoading } = useQueryResponse();
|
||||
@@ -72,7 +72,7 @@ const ModalForm: FC<Props> = ({ user, isUserLoading }) => {
|
||||
if (isNotEmpty(values.id)) {
|
||||
await updateUser(values);
|
||||
} else {
|
||||
await createSignatory(values);
|
||||
await createSignatory({employer_uid:showCustomModal?.data?.id, ...values});
|
||||
}
|
||||
} catch (ex) {
|
||||
console.error(ex);
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ const UserActionsCell: FC<Props> = ({id}) => {
|
||||
|
||||
{/* begin::Menu item */}
|
||||
<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
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -45,7 +45,7 @@ const getApprovedUsers = (query: string): Promise<UsersQueryResponse> => { // FU
|
||||
};
|
||||
|
||||
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> => {
|
||||
|
||||
@@ -9,15 +9,14 @@ import { User } from "../../../core/_models";
|
||||
|
||||
type Props = {
|
||||
id: ID;
|
||||
data?: Array<User> | any
|
||||
};
|
||||
|
||||
const UserActionsCell: FC<Props> = ({ id, data }) => {
|
||||
const UserActionsCell: FC<Props> = ({ id }) => {
|
||||
const { setItemIdForUpdate } = useListView();
|
||||
const { query } = useQueryResponse();
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
let selectedUser = data?.filter((item:User) => item.uid == id)[0]
|
||||
// let selectedUser = data?.filter((item:User) => item.uid == id)[0]
|
||||
|
||||
useEffect(() => {
|
||||
MenuComponent.reinitialization();
|
||||
@@ -27,7 +26,7 @@ const UserActionsCell: FC<Props> = ({ id, data }) => {
|
||||
setItemIdForUpdate(id);
|
||||
};
|
||||
|
||||
const empsVerify = useMutation(() => employersVerify(selectedUser?.employer_uid), {
|
||||
const empsVerify = useMutation(() => employersVerify(id), {
|
||||
// 💡 response of the mutation is passed to onSuccess
|
||||
onSuccess: () => {
|
||||
// ✅ update detail view directly
|
||||
|
||||
@@ -58,7 +58,7 @@ const usersColumns: ReadonlyArray<Column<User>> = [
|
||||
<UserCustomHeader tableProps={props} title='Actions' className='text-end min-w-100px' />
|
||||
),
|
||||
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 = {
|
||||
name?: string
|
||||
data?: {
|
||||
[index: string]: string | number | undefined;
|
||||
[index: string]: undefined | null | number | string;
|
||||
}
|
||||
}
|
||||
|
||||
type DataProps = {
|
||||
[index: string]: string | number | undefined;
|
||||
[index: string]: undefined | null | number | string;
|
||||
}
|
||||
|
||||
type ModalNames = {
|
||||
|
||||
Reference in New Issue
Block a user