Compare commits

...

3 Commits

Author SHA1 Message Date
CHIEFSOFT\ameye 4c16690702 digi fi back office sne doffer 2025-01-13 20:45:43 -05:00
CHIEFSOFT\ameye 6987fbf9b4 Chnage text 2025-01-12 18:42:53 -05:00
ameye eb3d337a2e Merge branch 'action-btn-update' of DigiFi/digifi-bko into master 2025-01-12 23:40:34 +00:00
2 changed files with 37 additions and 7 deletions
+4 -1
View File
@@ -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,
@@ -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 */}
</>