fix group
This commit is contained in:
@ -89,6 +89,10 @@ const ManageGroups = () => {
|
|||||||
|
|
||||||
const handleSubmit = async (e: React.FormEvent) => {
|
const handleSubmit = async (e: React.FormEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
if (!formData.groupName) return toast.warning(`Group name can not be empty!`)
|
||||||
|
if (!formData.status) return toast.warning(`Status can not be empty!`)
|
||||||
|
if (!formData.description) return toast.warning(`Description can not be empty!`)
|
||||||
|
setIsDialogOpen(false);
|
||||||
setDialogOpen(true);
|
setDialogOpen(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -198,7 +202,7 @@ const ManageGroups = () => {
|
|||||||
<Dialog open={isDialogOpen} onClose={closeDialog}>
|
<Dialog open={isDialogOpen} onClose={closeDialog}>
|
||||||
<DialogContent className="w-full">
|
<DialogContent className="w-full">
|
||||||
<div className="flex justify-between">
|
<div className="flex justify-between">
|
||||||
<DialogTitle>Create New Group</DialogTitle>
|
<DialogTitle>{dialogType==='create'?"Create New Group":"Update Group"}</DialogTitle>
|
||||||
<Box display="flex" justifyContent="flex-end">
|
<Box display="flex" justifyContent="flex-end">
|
||||||
<Button
|
<Button
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
|
|||||||
@ -200,7 +200,7 @@ const DetailMember = ({ showAddDialog, setShowAddDialog, handleSubmit, initialDa
|
|||||||
<Dialog open={showAddDialog} onOpenChange={(open) => handleAddDialog(open)}>
|
<Dialog open={showAddDialog} onOpenChange={(open) => handleAddDialog(open)}>
|
||||||
<DialogContent className="container-fixed max-w-[768px] flex flex-col p-5">
|
<DialogContent className="container-fixed max-w-[768px] flex flex-col p-5">
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>Member - View/Edit</DialogTitle>
|
<DialogTitle>Member - {dialogType ==='create' ? "Create" : "View/Edit"}</DialogTitle>
|
||||||
<DialogDescription></DialogDescription>
|
<DialogDescription></DialogDescription>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<DialogBody ref={parentRef}>
|
<DialogBody ref={parentRef}>
|
||||||
|
|||||||
Reference in New Issue
Block a user