added third
This commit was merged in pull request #549.
This commit is contained in:
@@ -4,7 +4,7 @@ import { useNavigate } from "react-router-dom";
|
||||
import usersService from "../../services/UsersService";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
import { useDispatch } from "react-redux";
|
||||
|
||||
import { apiConst } from "../../lib/apiConst";
|
||||
|
||||
function DeleteTaskModal({ details, onClose, situation, setReloadList }) {
|
||||
let dispatch = useDispatch();
|
||||
@@ -19,34 +19,50 @@ function DeleteTaskModal({ details, onClose, situation, setReloadList }) {
|
||||
|
||||
// FUNCTION TO DELETE TASK
|
||||
const deleteTask = () => {
|
||||
setRequestStatus({loading:true, status:false, message: ''})
|
||||
setRequestStatus({ loading: true, status: false, message: "" });
|
||||
|
||||
let reqData = { // REQUEST PAYLOAD
|
||||
let reqData = {
|
||||
// REQUEST PAYLOAD
|
||||
suggest_uid: details.uid,
|
||||
suggest_action: 555,
|
||||
offset: 0
|
||||
}
|
||||
ApiCall.suggestStatus(reqData).then((response)=>{ // API CALL TO DELETE SUGGESTED TASK
|
||||
let {data} = response
|
||||
if(data.internal_return < 0){
|
||||
setRequestStatus({loading:false, status:false, message: 'Unable to delete, Try again'})
|
||||
return setTimeout(()=>{
|
||||
setRequestStatus({loading:false, status:false, message: ''})
|
||||
},3000)
|
||||
}
|
||||
setRequestStatus({loading:false, status:true, message: 'Family Suggest Deleted'})
|
||||
setReloadList(prev => !prev) // RELOADS THE FAMILY SUGGEST LIST TABLE
|
||||
setTimeout(()=>{
|
||||
setRequestStatus({loading:false, status:false, message: ''})
|
||||
onClose()
|
||||
},3000)
|
||||
}).catch(error => {
|
||||
setRequestStatus({loading:false, status:false, message: 'Unable to delete, Try again'})
|
||||
setTimeout(()=>{
|
||||
setRequestStatus({loading:false, status:false, message: ''})
|
||||
},3000)
|
||||
})
|
||||
}
|
||||
suggest_action: apiConst.WRENCHBOARD_COMPLETE_SENDMONEY_INTERSW,
|
||||
offset: 0,
|
||||
};
|
||||
ApiCall.suggestStatus(reqData)
|
||||
.then((response) => {
|
||||
// API CALL TO DELETE SUGGESTED TASK
|
||||
let { data } = response;
|
||||
if (data.internal_return < 0) {
|
||||
setRequestStatus({
|
||||
loading: false,
|
||||
status: false,
|
||||
message: "Unable to delete, Try again",
|
||||
});
|
||||
return setTimeout(() => {
|
||||
setRequestStatus({ loading: false, status: false, message: "" });
|
||||
}, 3000);
|
||||
}
|
||||
setRequestStatus({
|
||||
loading: false,
|
||||
status: true,
|
||||
message: "Family Suggest Deleted",
|
||||
});
|
||||
setReloadList((prev) => !prev); // RELOADS THE FAMILY SUGGEST LIST TABLE
|
||||
setTimeout(() => {
|
||||
setRequestStatus({ loading: false, status: false, message: "" });
|
||||
onClose();
|
||||
}, 3000);
|
||||
})
|
||||
.catch((error) => {
|
||||
setRequestStatus({
|
||||
loading: false,
|
||||
status: false,
|
||||
message: "Unable to delete, Try again",
|
||||
});
|
||||
setTimeout(() => {
|
||||
setRequestStatus({ loading: false, status: false, message: "" });
|
||||
}, 3000);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<ModalCom action={onClose} situation={situation}>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useNavigate } from "react-router-dom";
|
||||
import usersService from "../../services/UsersService";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
import { useDispatch } from "react-redux";
|
||||
|
||||
import { apiConst } from "../../lib/apiConst";
|
||||
|
||||
function SendReminderModal({ details, onClose, situation, setReloadList }) {
|
||||
let dispatch = useDispatch();
|
||||
@@ -19,34 +19,50 @@ function SendReminderModal({ details, onClose, situation, setReloadList }) {
|
||||
|
||||
// FUNCTION TO SEND REMINDER
|
||||
const sendReminder = () => {
|
||||
setRequestStatus({loading:true, status:false, message: ''})
|
||||
setRequestStatus({ loading: true, status: false, message: "" });
|
||||
|
||||
let reqData = { // REQUEST PAYLOAD
|
||||
let reqData = {
|
||||
// REQUEST PAYLOAD
|
||||
suggest_uid: details.uid,
|
||||
suggest_action: 222,
|
||||
offset: 0
|
||||
}
|
||||
ApiCall.suggestStatus(reqData).then((response)=>{ // API CALL TO DELETE SUGGESTED TASK
|
||||
let {data} = response
|
||||
if(data.internal_return < 0){
|
||||
setRequestStatus({loading:false, status:false, message: 'Unable to send reminder, Try again1111'})
|
||||
return setTimeout(()=>{
|
||||
setRequestStatus({loading:false, status:false, message: ''})
|
||||
},3000)
|
||||
}
|
||||
setRequestStatus({loading:false, status:true, message: 'Reminder Sent'})
|
||||
setReloadList(prev => !prev) // RELOADS THE FAMILY SUGGEST LIST TABLE
|
||||
setTimeout(()=>{
|
||||
setRequestStatus({loading:false, status:false, message: ''})
|
||||
onClose()
|
||||
},3000)
|
||||
}).catch(error => {
|
||||
setRequestStatus({loading:false, status:false, message: 'Unable to send reminder, Try againNETWORK'})
|
||||
setTimeout(()=>{
|
||||
setRequestStatus({loading:false, status:false, message: ''})
|
||||
},3000)
|
||||
})
|
||||
}
|
||||
suggest_action: apiConst.OFFER_CANCEL,
|
||||
offset: 0,
|
||||
};
|
||||
ApiCall.suggestStatus(reqData)
|
||||
.then((response) => {
|
||||
// API CALL TO DELETE SUGGESTED TASK
|
||||
let { data } = response;
|
||||
if (data.internal_return < 0) {
|
||||
setRequestStatus({
|
||||
loading: false,
|
||||
status: false,
|
||||
message: "Unable to send reminder, Try again1111",
|
||||
});
|
||||
return setTimeout(() => {
|
||||
setRequestStatus({ loading: false, status: false, message: "" });
|
||||
}, 3000);
|
||||
}
|
||||
setRequestStatus({
|
||||
loading: false,
|
||||
status: true,
|
||||
message: "Reminder Sent",
|
||||
});
|
||||
setReloadList((prev) => !prev); // RELOADS THE FAMILY SUGGEST LIST TABLE
|
||||
setTimeout(() => {
|
||||
setRequestStatus({ loading: false, status: false, message: "" });
|
||||
onClose();
|
||||
}, 3000);
|
||||
})
|
||||
.catch((error) => {
|
||||
setRequestStatus({
|
||||
loading: false,
|
||||
status: false,
|
||||
message: "Unable to send reminder, Try againNETWORK",
|
||||
});
|
||||
setTimeout(() => {
|
||||
setRequestStatus({ loading: false, status: false, message: "" });
|
||||
}, 3000);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<ModalCom action={onClose} situation={situation}>
|
||||
@@ -82,27 +98,32 @@ function SendReminderModal({ details, onClose, situation, setReloadList }) {
|
||||
</button>
|
||||
</div>
|
||||
<div className="logout-modal-body w-full flex flex-col items-center p-8">
|
||||
|
||||
<div className="mb-6 w-full flex gap-4 items-center">
|
||||
<div className="mb-6 w-full flex gap-4 items-center">
|
||||
<div className="icon max-w-[150px] min-w-[150px] max-h-[150px] min-h-[150px] flex justify-center items-center">
|
||||
<img src={require(`../../assets/images/family/${details.banner || "default.jpg"}`)} alt="" className="w-full h-full" />
|
||||
<img
|
||||
src={require(`../../assets/images/family/${
|
||||
details.banner || "default.jpg"
|
||||
}`)}
|
||||
alt=""
|
||||
className="w-full h-full"
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<p className="text-xl font-bold text-dark-gray dark:text-white mb-2 capitalize line-clamp-1">
|
||||
{details.title}
|
||||
</p>
|
||||
<p className="text-xl font-bold text-dark-gray dark:text-white mb-2 capitalize line-clamp-1">
|
||||
{details.title}
|
||||
</p>
|
||||
|
||||
<p className="text-sm mb-2 text-thin-light-gray font-medium">
|
||||
{details.description}
|
||||
</p>
|
||||
{
|
||||
details.remind &&
|
||||
<p className="text-sm mb-2 text-thin-light-gray font-medium">
|
||||
{details.description}
|
||||
</p>
|
||||
{details.remind && (
|
||||
<p className="text-xl font-bold text-dark-gray dark:text-white mb-2 capitalize line-clamp-1">
|
||||
Last Remind: {new Date(details.remind).toLocaleString().split(',')[0]}
|
||||
Last Remind:{" "}
|
||||
{new Date(details.remind).toLocaleString().split(",")[0]}
|
||||
</p>
|
||||
}
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="w-full flex justify-end">
|
||||
{/* <button
|
||||
|
||||
Reference in New Issue
Block a user