confirm data and reject data
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { CONFIRM_PASSENGER_OFFICE } from "@/core/data/apiRoutes";
|
||||
import {
|
||||
Dialog,
|
||||
DialogTitle,
|
||||
@@ -13,11 +14,12 @@ const ConfirmForm = ({
|
||||
handleClose,
|
||||
handleDelete,
|
||||
rowId,
|
||||
deleteData,
|
||||
confirmData,
|
||||
}) => {
|
||||
const t = useTranslations();
|
||||
const handleDeleteExpert = () => {
|
||||
const handleConfirm = () => {
|
||||
handleDelete();
|
||||
confirmData(CONFIRM_PASSENGER_OFFICE, rowId);
|
||||
};
|
||||
return (
|
||||
<Dialog open={open} onClose={handleClose}>
|
||||
@@ -26,7 +28,7 @@ const ConfirmForm = ({
|
||||
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={handleDeleteExpert} color="primary">
|
||||
<Button onClick={handleConfirm} color="primary">
|
||||
{t("ConfirmDialog.button-confirm")}
|
||||
</Button>
|
||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { REJECT_PASSENGER_OFFICE } from "@/core/data/apiRoutes";
|
||||
import {
|
||||
Dialog,
|
||||
DialogTitle,
|
||||
@@ -8,12 +9,12 @@ import {
|
||||
} from "@mui/material";
|
||||
import { useTranslations } from "next-intl";
|
||||
|
||||
const RejectForm = ({ open, handleClose, handleDelete, rowId, deleteData }) => {
|
||||
const RejectForm = ({ open, handleClose, handleDelete, rowId, rejectData }) => {
|
||||
const t = useTranslations();
|
||||
const handleRejectRequest = () => {
|
||||
handleDelete();
|
||||
rejectData(REJECT_PASSENGER_OFFICE, rowId);
|
||||
};
|
||||
console.log(rowId);
|
||||
return (
|
||||
<Dialog open={open} onClose={handleClose}>
|
||||
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
||||
|
||||
@@ -19,7 +19,8 @@ const TableRowActions = ({ row }) => {
|
||||
handleConfirmDialog,
|
||||
handleRejectDialog,
|
||||
rowId,
|
||||
deleteData,
|
||||
confirmData,
|
||||
rejectData,
|
||||
} = useContext(DataTableContext);
|
||||
return (
|
||||
<Box sx={{ display: "flex", flexWrap: "nowrap", gap: "8px" }}>
|
||||
@@ -31,7 +32,7 @@ const TableRowActions = ({ row }) => {
|
||||
open={openConfirmDialog}
|
||||
handleClose={handleCloseConfirmDialog}
|
||||
handleDelete={handleConfirmDialog}
|
||||
deleteData={deleteData}
|
||||
confirmData={confirmData}
|
||||
/>
|
||||
<IconButton color="primary" onClick={() => handleOpenRejectDialog(row)}>
|
||||
<ThumbDownIcon />
|
||||
@@ -41,7 +42,7 @@ const TableRowActions = ({ row }) => {
|
||||
open={openRejectDialog}
|
||||
handleClose={handleCloseRejectDialog}
|
||||
handleDelete={handleRejectDialog}
|
||||
deleteData={deleteData}
|
||||
rejectData={rejectData}
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user