mirror of
https://github.com/WDI-Ideas/rubix-admin-panel.git
synced 2026-04-27 19:25:51 +00:00
Fixed NewLetter email delete function
This commit is contained in:
@@ -181,8 +181,13 @@ const NewsLetter = () => {
|
||||
size={"xs"}
|
||||
colorScheme="red"
|
||||
variant="ghost"
|
||||
// onClick={() => {
|
||||
// setDeleteAlert(true);
|
||||
// }}
|
||||
onClick={() => {
|
||||
setActionId(item.id);
|
||||
setDeleteAlert(true);
|
||||
setActionStatus(item.status);
|
||||
}}
|
||||
>
|
||||
<DeleteIcon me={2} /> Delete
|
||||
@@ -214,57 +219,13 @@ const NewsLetter = () => {
|
||||
totalPages={email?.data?.data?.totalPages}
|
||||
noDataTitle={"NewsLetter"}
|
||||
/>
|
||||
{/* <CustomAlertDialog
|
||||
<CustomAlertDialog
|
||||
onClose={() => setDeleteAlert(false)}
|
||||
isOpen={deleteAlert}
|
||||
alertHandler={() => handleDelete(actionId)}
|
||||
message={"Are you sure you want to delete Email?"}
|
||||
isLoading={deleteIsLoading}
|
||||
/> */}
|
||||
|
||||
<AlertDialog
|
||||
motionPreset="slideInBottom"
|
||||
// leastDestructiveRef={cancelRef}
|
||||
onClose={() => setDeleteAlert(false)}
|
||||
isOpen={deleteAlert}
|
||||
isCentered
|
||||
>
|
||||
<AlertDialogOverlay />
|
||||
|
||||
<AlertDialogContent w={400}>
|
||||
<AlertDialogCloseButton className="web-text-xsmall link" />
|
||||
<AlertDialogBody
|
||||
className="text-center web-text-large fw-bold"
|
||||
pt={8}
|
||||
>
|
||||
Are you sure you want to delete Email?
|
||||
</AlertDialogBody>
|
||||
<AlertDialogFooter display={"flex"} justifyContent={"center"}>
|
||||
<Button
|
||||
size={"sm"}
|
||||
// ref={cancelRef}
|
||||
onClick={() => setDeleteAlert(false)}
|
||||
>
|
||||
No
|
||||
</Button>
|
||||
<Button
|
||||
backgroundColor={"#ff6b6b"}
|
||||
isLoading={deleteIsLoading}
|
||||
// onClick={() => {
|
||||
// email.forEach((item) => {
|
||||
// handleDelete(item.id);
|
||||
// });
|
||||
// }}
|
||||
onClick={() => handleDelete(actionId)}
|
||||
size={"sm"}
|
||||
colorScheme="red"
|
||||
ml={3}
|
||||
>
|
||||
Yes
|
||||
</Button>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user