reject member
This commit is contained in:
@ -12,11 +12,10 @@ import {
|
||||
FormControl,
|
||||
Typography
|
||||
} from "@mui/material";
|
||||
import axios from 'axios';
|
||||
import Divider from '@mui/material/Divider';
|
||||
import { initialMember } from "./Columns";
|
||||
|
||||
const CustomerDialog = ({ open, handleClose, handleSubmit, initialData, viewStats }: any) => {
|
||||
const CustomerDialog = ({ open, handleClose, handleSubmit, initialData, viewStats, handleReject }: any) => {
|
||||
const [formData, setFormData] = useState(initialData || initialMember);
|
||||
const [viewOnly, setViewOnly] = useState(viewStats || false);
|
||||
|
||||
@ -35,6 +34,11 @@ const CustomerDialog = ({ open, handleClose, handleSubmit, initialData, viewStat
|
||||
handleClose();
|
||||
};
|
||||
|
||||
const onReject = () => {
|
||||
handleReject(formData);
|
||||
handleClose();
|
||||
}
|
||||
|
||||
function generateDate(date: any, type: any) {
|
||||
if (!date) return ''
|
||||
const today = new Date(date);
|
||||
@ -44,7 +48,7 @@ const CustomerDialog = ({ open, handleClose, handleSubmit, initialData, viewStat
|
||||
|
||||
return (
|
||||
<Dialog open={open} onClose={handleClose} fullWidth maxWidth="sm">
|
||||
<DialogTitle>Customer Form ({viewStats ? 'View' : 'Edit'})</DialogTitle>
|
||||
<DialogTitle>Customer Form ({viewOnly ? 'View' : 'Edit'})</DialogTitle>
|
||||
<DialogContent>
|
||||
<div className="flex justify-between pb-5">
|
||||
<Typography sx={{color:'grey'}}>Customer Data</Typography>
|
||||
@ -138,7 +142,7 @@ const CustomerDialog = ({ open, handleClose, handleSubmit, initialData, viewStat
|
||||
<Button onClick={handleClose} color="secondary">Cancel</Button>
|
||||
{
|
||||
formData.isneedapproval == 1 ? (
|
||||
<Button onClick={onSubmit} color="warning" variant="contained">Reject</Button>
|
||||
<Button onClick={onReject} color="warning" variant="contained">Reject</Button>
|
||||
) : ('')
|
||||
}
|
||||
<Button onClick={onSubmit} color="primary" variant="contained">
|
||||
|
||||
Reference in New Issue
Block a user