digi fi back office sne doffer
This commit is contained in:
@@ -49,6 +49,9 @@ const getApprovedUsers = (query: string): Promise<UsersQueryResponse> => { // FU
|
||||
.get(`${NEW_USER_ENDPOINT}/loan/approved`)
|
||||
.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
|
||||
return postAuxEnd('/employers/verify', {application_uid:uid})
|
||||
@@ -97,7 +100,7 @@ export {
|
||||
getApprovedUsers,
|
||||
employersVerify,
|
||||
getVerifiedLoanDetailsByUID,
|
||||
|
||||
sendServerOffer,
|
||||
deleteUser,
|
||||
deleteSelectedUsers,
|
||||
getUserById,
|
||||
|
||||
@@ -72,7 +72,7 @@ const UserActionsCell: FC<Props> = ({ id }) => {
|
||||
data-kt-users-table-filter="delete_row"
|
||||
onClick={async () => resendVerification()}
|
||||
>
|
||||
Disburse Loan
|
||||
Employer Verification
|
||||
</a>
|
||||
</div>
|
||||
{/* end::Menu item */}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { FC, useEffect } from "react";
|
||||
import { useQueryClient } from "react-query";
|
||||
import {useMutation, useQueryClient} from "react-query";
|
||||
import { MenuComponent } from "../../../../../../_digifi/assets/ts/components";
|
||||
import { ID, KTIcon, QUERIES } from "../../../../../../_digifi/helpers";
|
||||
import { useListView } from "../../core/ListViewProvider";
|
||||
@@ -7,6 +7,7 @@ import { useQueryResponse } from "../../core/QueryResponseProvider";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
import { User } from "../../../core/_models";
|
||||
import {sendServerOffer} from "../../../core/_requests.ts";
|
||||
|
||||
type Props = {
|
||||
id: ID;
|
||||
@@ -24,7 +25,23 @@ const UserActionsCell: FC<Props> = ({ id, data }) => {
|
||||
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
|
||||
href="#"
|
||||
@@ -42,11 +59,21 @@ const UserActionsCell: FC<Props> = ({ id, data }) => {
|
||||
>
|
||||
{/* begin::Menu item */}
|
||||
<div className="menu-item px-3">
|
||||
<Link state={{selectedUser}} to='/loan/verified/process' className="menu-link px-3">
|
||||
Process
|
||||
</Link>
|
||||
<a
|
||||
className="menu-link px-3"
|
||||
data-kt-users-table-filter="delete_row"
|
||||
onClick={async () => sendUserOffer()}
|
||||
>
|
||||
Send Offer
|
||||
</a>
|
||||
</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>
|
||||
{/* end::Menu */}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user