Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4c16690702 | |||
| 6987fbf9b4 | |||
| eb3d337a2e |
@@ -49,6 +49,9 @@ const getApprovedUsers = (query: string): Promise<UsersQueryResponse> => { // FU
|
|||||||
.get(`${NEW_USER_ENDPOINT}/loan/approved`)
|
.get(`${NEW_USER_ENDPOINT}/loan/approved`)
|
||||||
.then((d: AxiosResponse<UsersQueryResponse>) => d.data);
|
.then((d: AxiosResponse<UsersQueryResponse>) => d.data);
|
||||||
};
|
};
|
||||||
|
const sendServerOffer = (uid: ID): Promise<UsersQueryResponse> => { // FUNCTION FOR EMPLOYERS VERIFICATION
|
||||||
|
return postAuxEnd('/loan/send_offer', {application_uid:uid})
|
||||||
|
};
|
||||||
|
|
||||||
const employersVerify = (uid: ID): Promise<UsersQueryResponse> => { // FUNCTION FOR EMPLOYERS VERIFICATION
|
const employersVerify = (uid: ID): Promise<UsersQueryResponse> => { // FUNCTION FOR EMPLOYERS VERIFICATION
|
||||||
return postAuxEnd('/employers/verify', {application_uid:uid})
|
return postAuxEnd('/employers/verify', {application_uid:uid})
|
||||||
@@ -97,7 +100,7 @@ export {
|
|||||||
getApprovedUsers,
|
getApprovedUsers,
|
||||||
employersVerify,
|
employersVerify,
|
||||||
getVerifiedLoanDetailsByUID,
|
getVerifiedLoanDetailsByUID,
|
||||||
|
sendServerOffer,
|
||||||
deleteUser,
|
deleteUser,
|
||||||
deleteSelectedUsers,
|
deleteSelectedUsers,
|
||||||
getUserById,
|
getUserById,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { FC, useEffect } from "react";
|
import { FC, useEffect } from "react";
|
||||||
import { useQueryClient } from "react-query";
|
import {useMutation, useQueryClient} from "react-query";
|
||||||
import { MenuComponent } from "../../../../../../_digifi/assets/ts/components";
|
import { MenuComponent } from "../../../../../../_digifi/assets/ts/components";
|
||||||
import { ID, KTIcon, QUERIES } from "../../../../../../_digifi/helpers";
|
import { ID, KTIcon, QUERIES } from "../../../../../../_digifi/helpers";
|
||||||
import { useListView } from "../../core/ListViewProvider";
|
import { useListView } from "../../core/ListViewProvider";
|
||||||
@@ -7,6 +7,7 @@ import { useQueryResponse } from "../../core/QueryResponseProvider";
|
|||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
import { User } from "../../../core/_models";
|
import { User } from "../../../core/_models";
|
||||||
|
import {sendServerOffer} from "../../../core/_requests.ts";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
id: ID;
|
id: ID;
|
||||||
@@ -24,7 +25,23 @@ const UserActionsCell: FC<Props> = ({ id, data }) => {
|
|||||||
MenuComponent.reinitialization();
|
MenuComponent.reinitialization();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
const sendApplicationOffer = useMutation(() => sendServerOffer(id), {
|
||||||
|
// 💡 response of the mutation is passed to onSuccess
|
||||||
|
onSuccess: () => {
|
||||||
|
// ✅ update detail view directly
|
||||||
|
// queryClient.invalidateQueries([`${QUERIES.READY_LIST}-${query}`]);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const sendUserOffer = async () => { // FUNCTION TO RESEND VERIFICATION
|
||||||
|
let cont = confirm('Are you sure, you want to send resend offer ?')
|
||||||
|
if(cont){
|
||||||
|
await sendApplicationOffer.mutateAsync()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
<>
|
<>
|
||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
@@ -42,11 +59,21 @@ const UserActionsCell: FC<Props> = ({ id, data }) => {
|
|||||||
>
|
>
|
||||||
{/* begin::Menu item */}
|
{/* begin::Menu item */}
|
||||||
<div className="menu-item px-3">
|
<div className="menu-item px-3">
|
||||||
<Link state={{selectedUser}} to='/loan/verified/process' className="menu-link px-3">
|
<a
|
||||||
Process
|
className="menu-link px-3"
|
||||||
</Link>
|
data-kt-users-table-filter="delete_row"
|
||||||
|
onClick={async () => sendUserOffer()}
|
||||||
|
>
|
||||||
|
Send Offer
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{/* end::Menu item */}
|
|
||||||
|
<div className="menu-item px-3">
|
||||||
|
<Link state={{selectedUser}} to='/loan/verified/process' className="menu-link px-3">
|
||||||
|
Process Loan
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{/* end::Menu */}
|
{/* end::Menu */}
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user