employer verify application uid updated #33
@@ -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} />,
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user