update subadmin

This commit is contained in:
YasinShaikh123
2024-12-12 13:39:19 +05:30
parent f9c7bf9d5d
commit 49f39e1c2c
5 changed files with 15 additions and 11 deletions

View File

@@ -83,7 +83,7 @@ const ChangePassword = ({
render: () => <ToastBox message={res?.data?.message} />,
});
handleClose();
} else if (res?.error) {
} else if (res?.error.statusCode === 400) {
toast({
render: () => (
<ToastBox message={res?.error?.data?.message} status={"error"} />

View File

@@ -316,7 +316,7 @@ const AddInvestmentType = () => {
<Box display={"flex"} justifyContent={"space-between"} alignItems={"center"} mt={5} px={4} mb={5}>
<Text fontSize={"sm"} mb={0} onClick={() => navigate(-1)} cursor={"pointer"}>
<ArrowBackIcon fontSize={"xl"} me={2} />Add Details
<ArrowBackIcon fontSize={"xl"} me={2} />{params?.id ? "Edit Details" : "Add Details"}
</Text>
<SwitchButton isSwitchOn={isSwitchOn} setIsSwitchOn={setIsSwitchOn} />
</Box>

View File

@@ -301,7 +301,7 @@ const AddSponser = () => {
{/* ===================== [Switch Button] ======================== */}
<Box display={"flex"} justifyContent={"space-between"} alignItems={"center"} mt={5} px={4}>
<Text fontSize={"sm"} mb={0} onClick={() => navigate(-1)} cursor={"pointer"}>
<ArrowBackIcon fontSize={"xl"} me={2} />Add Details
<ArrowBackIcon fontSize={"xl"} me={2} />{params?.id ? "Edit Details" : "Add Details"}
</Text>
<SwitchButton isSwitchOn={isSwitchOn} setIsSwitchOn={setIsSwitchOn} />
</Box>

View File

@@ -188,7 +188,7 @@ const SubAdmin = () => {
>
{item?.role[0]?.role}
</Badge>
<Switch
{/* <Switch
onChange={() =>
handleToggleStatus(item?.role[0]?.role === "Maker", item?.id)
}
@@ -199,7 +199,7 @@ const SubAdmin = () => {
bg: item?.role[0]?.role === "Maker" ? "#00ffcc" : "#b3ff99", // "Off" state color
},
}}
/>
/> */}
{/* <RoleSwitchButton
setIsSwitchOn={setIsSwitchOn}
isSwitchOn={item?.role[0]?.role === "Maker"}

View File

@@ -111,7 +111,7 @@ const SubAdminUpdateCreate = () => {
try {
const formData = {
...form,
// role_xid: !isSwitchOn ? 1 : 2,
role_xid: !isSwitchOn ? 2 : 1,
};
await updateSubAdmin({ data: formData, id }).then((response) => {
if (response?.data?.statusCode) {
@@ -211,7 +211,7 @@ const SubAdminUpdateCreate = () => {
name: "emailAddress",
placeHolder: " ",
type: "email",
// isRequired: true,
isRequired: true,
section: "",
},
];
@@ -248,7 +248,7 @@ const SubAdminUpdateCreate = () => {
name: "emailAddress",
placeHolder: " ",
type: "email",
// isRequired: true,
isRequired: true,
section: "",
},
];
@@ -306,16 +306,20 @@ const SubAdminUpdateCreate = () => {
cursor={"pointer"}
>
<ArrowBackIcon fontSize={"xl"} me={2} />
Add Details
{params?.id ? "Edit Details" : "Add Details"}
</Text>
{params?.id ? (
{/* {params?.id ? (
""
) : (
<RoleSwitchButton
isSwitchOn={isSwitchOn}
setIsSwitchOn={setIsSwitchOn}
/>
)}
)} */}
<RoleSwitchButton
isSwitchOn={isSwitchOn}
setIsSwitchOn={setIsSwitchOn}
/>
</Box>
{/* ====================== [Form Input] ====================== */}