mirror of
https://github.com/WDI-Ideas/rubix-admin-panel.git
synced 2026-04-27 19:25:51 +00:00
Merge branch 'dev' of https://github.com/WDI-Ideas/rubix-admin-panel into dev
This commit is contained in:
@@ -38,8 +38,7 @@ const BannerCommunity = ({
|
||||
title,
|
||||
addLink,
|
||||
viewLink,
|
||||
editLink
|
||||
|
||||
editLink,
|
||||
}) => {
|
||||
// ====================================================[Hooks]===================================================================
|
||||
const toast = useToast();
|
||||
@@ -57,8 +56,6 @@ const BannerCommunity = ({
|
||||
// end: pageSize,
|
||||
// });
|
||||
|
||||
|
||||
|
||||
// ====================================================[Functions]===================================================================
|
||||
const handleDelete = async (bannerId, status) => {
|
||||
if (status) {
|
||||
@@ -67,7 +64,6 @@ const BannerCommunity = ({
|
||||
<ToastBox status={"warn"} message="You cant delete active banner" />
|
||||
),
|
||||
});
|
||||
|
||||
}
|
||||
try {
|
||||
// Trigger the mutation
|
||||
@@ -81,7 +77,10 @@ const BannerCommunity = ({
|
||||
setDeleteAlert(false);
|
||||
toast({
|
||||
render: () => (
|
||||
<ToastBox status={"success"} message={response?.data?.message} />
|
||||
<ToastBox
|
||||
status={"success"}
|
||||
message={response?.data?.message}
|
||||
/>
|
||||
),
|
||||
});
|
||||
}
|
||||
@@ -104,27 +103,25 @@ const BannerCommunity = ({
|
||||
<ToastBox status={"warn"} message={"Please toggle another banner."} />
|
||||
),
|
||||
});
|
||||
}else{
|
||||
|
||||
try {
|
||||
// Trigger the mutation
|
||||
await statusUpdateApi({ id })
|
||||
.then((response) => {
|
||||
if (response?.data?.statusCode === 201) {
|
||||
toast({
|
||||
render: () => <ToastBox message={response?.data?.message} />,
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
} catch (error) {
|
||||
// Handle errors
|
||||
console.error("Error updating community status:", error);
|
||||
} else {
|
||||
try {
|
||||
// Trigger the mutation
|
||||
await statusUpdateApi({ id })
|
||||
.then((response) => {
|
||||
if (response?.data?.statusCode === 201) {
|
||||
toast({
|
||||
render: () => <ToastBox message={response?.data?.message} />,
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
} catch (error) {
|
||||
// Handle errors
|
||||
console.error("Error updating community status:", error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// ====================================================[Table Filter]================================================================
|
||||
@@ -238,7 +235,7 @@ const BannerCommunity = ({
|
||||
onClick={() => {
|
||||
setActionId(item.id);
|
||||
setDeleteAlert(true);
|
||||
setActionStatus(item.status)
|
||||
setActionStatus(item.status);
|
||||
}}
|
||||
className="web-text-medium"
|
||||
>
|
||||
|
||||
@@ -273,7 +273,7 @@ const EditVideos = () => {
|
||||
maxLength={90}
|
||||
/>
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum characters must be 100 characters.
|
||||
Pls mention Hrs/mins/secs in the field.
|
||||
</FormHelperText>
|
||||
|
||||
{errors.duration && (
|
||||
@@ -296,7 +296,7 @@ const EditVideos = () => {
|
||||
maxLength={90}
|
||||
/>
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum characters must be 100 characters.
|
||||
Please enter the embedded youtube Url.
|
||||
</FormHelperText>
|
||||
|
||||
{errors.embeddedCode && (
|
||||
|
||||
Reference in New Issue
Block a user