updated
This commit is contained in:
@@ -19,6 +19,7 @@ import CustomAlertDialog from "../../Components/CustomAlertDialog";
|
||||
import { formatDate } from "../../Components/Functions/UTCConvertor";
|
||||
import { CheckIcon, CloseIcon } from "@chakra-ui/icons";
|
||||
import DeletionRequestApprove from "./DeletionRequestApprove";
|
||||
import { useGetDeleteRequestQuery } from "../../Services/delete.request.service";
|
||||
// import { formatDate } from "../../Components/Functions/UTCConvertor";
|
||||
|
||||
const DeletionRequest = () => {
|
||||
@@ -32,6 +33,12 @@ const DeletionRequest = () => {
|
||||
const [mouseEntered, setMouseEntered] = useState(false);
|
||||
const [mouseEnteredId, setMouseEnteredId] = useState("");
|
||||
|
||||
const {
|
||||
data,
|
||||
isLoading: DeletionLoading
|
||||
} = useGetDeleteRequestQuery()
|
||||
|
||||
|
||||
const {
|
||||
isOpen: isConfirmOpen,
|
||||
onOpen: onConfirmOpen,
|
||||
@@ -55,7 +62,7 @@ const DeletionRequest = () => {
|
||||
}, []);
|
||||
|
||||
// ====================================================[Table Filter]================================================================
|
||||
const filteredData = deleteRequest?.filter((item) => {
|
||||
const filteredData = data?.data?.filter((item) => {
|
||||
// Filter by name (case insensitive)
|
||||
const name = item?.firstName;
|
||||
const searchLower = searchTerm.toLowerCase();
|
||||
@@ -107,7 +114,7 @@ const DeletionRequest = () => {
|
||||
className="d-flex align-items-center web-text-small"
|
||||
fontWeight={'500'}
|
||||
>
|
||||
{formatDate(item?.RequestedOn)}
|
||||
{formatDate(item?.RequestOn)}
|
||||
</Text>
|
||||
),
|
||||
"Client ID": (
|
||||
@@ -253,7 +260,7 @@ const DeletionRequest = () => {
|
||||
emptyMessage={`We don't have any Sponers `}
|
||||
tableHeadRow={tableHeadRow}
|
||||
data={extractedArray}
|
||||
isLoading={isLoading}
|
||||
isLoading={DeletionLoading}
|
||||
viewActionId={actionId}
|
||||
setViewActionId={setActionId}
|
||||
// totalPages={10}
|
||||
|
||||
@@ -30,7 +30,7 @@ import { useApproveDepositRequestMutation, useGetDeleteRequestByIdQuery } from "
|
||||
const FILE_TYPES = ["image/jpeg", "image/png", "image/gif"];
|
||||
|
||||
export const conformModalSchema = yup.object().shape({
|
||||
comment: yup.string().notRequired(),
|
||||
adminComment: yup.string().notRequired(),
|
||||
});
|
||||
|
||||
const DeletionRequestApprove = ({ isOpen, onClose, firstField, id, data:requestData }) => {
|
||||
@@ -68,7 +68,7 @@ const DeletionRequestApprove = ({ isOpen, onClose, firstField, id, data:requestD
|
||||
setIsBtnLoading(isReject?false:true)
|
||||
setIsBtnLoadingReject(isReject)
|
||||
const approveReq = {
|
||||
adminComment:data?.comment,
|
||||
adminComment:data?.adminComment,
|
||||
deletionStatus: isReject?"Reject": "Approved"
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ const DeletionRequestApprove = ({ isOpen, onClose, firstField, id, data:requestD
|
||||
<ModalBody>
|
||||
<FormControl mt={6} mb={4}>
|
||||
<FormLabel fontSize="sm">Investor Comment <Badge colorScheme="green">{fileredData?.currencyCode}</Badge></FormLabel>
|
||||
<Textarea
|
||||
{/* <Textarea
|
||||
focusBorderColor="green.400"
|
||||
name="comment"
|
||||
{...register("comment")}
|
||||
@@ -148,24 +148,27 @@ const DeletionRequestApprove = ({ isOpen, onClose, firstField, id, data:requestD
|
||||
<Text fontSize="xs" color="red">
|
||||
{errors.comment.message}
|
||||
</Text>
|
||||
)}
|
||||
)} */}
|
||||
|
||||
|
||||
<Text fontSize="sm" fontWeight={500} color={'gray.600'}>{data?.data?.comment}</Text>
|
||||
</FormControl>
|
||||
<FormControl mb={4}>
|
||||
<FormLabel fontSize="sm">Admin Comment</FormLabel>
|
||||
<Textarea
|
||||
rows={5}
|
||||
focusBorderColor="green.400"
|
||||
name="comment"
|
||||
{...register("comment")}
|
||||
name="adminComment"
|
||||
{...register("adminComment")}
|
||||
fontSize="sm"
|
||||
type="textarea"
|
||||
size="sm"
|
||||
placeholder={"Enter your comments...."}
|
||||
resize={"none"}
|
||||
/>
|
||||
{errors.comment && (
|
||||
{errors.adminComment && (
|
||||
<Text fontSize="xs" color="red">
|
||||
{errors.comment.message}
|
||||
{errors.adminComment.message}
|
||||
</Text>
|
||||
)}
|
||||
</FormControl>
|
||||
|
||||
@@ -14,7 +14,7 @@ export const deleteRequest = createApi({
|
||||
|
||||
|
||||
getDeleteRequest: builder.query({
|
||||
query: () => `/account/admin/pending-requests`,
|
||||
query: () => `/account/admin/pending-request`,
|
||||
providesTags: ["getDepositRequest"],
|
||||
}),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user