feat: fixing set banner and pop up (minor)
This commit is contained in:
parent
4ef9d5b513
commit
89375f00b1
|
|
@ -58,16 +58,6 @@ const columns: ColumnDef<any>[] = [
|
|||
<span>{formatDateToIndonesian(row.getValue("createdAt"))}</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorKey: "isStaticBanner",
|
||||
header: "Static Banner",
|
||||
cell: ({ row }) => (
|
||||
<StaticToogle
|
||||
id={row.original.id}
|
||||
initChecked={row.original.isStaticBanner}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorKey: "statusName",
|
||||
header: "Status Banner",
|
||||
|
|
@ -75,7 +65,6 @@ const columns: ColumnDef<any>[] = [
|
|||
<StatusToogle id={row.original.id} initChecked={row.original.isBanner} />
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
id: "actions",
|
||||
accessorKey: "action",
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ export default function AdminBanner() {
|
|||
: "bg-white text-black "
|
||||
}`}
|
||||
>
|
||||
Kontent
|
||||
Konten
|
||||
</Button>
|
||||
<Button
|
||||
rounded="md"
|
||||
|
|
|
|||
|
|
@ -58,24 +58,13 @@ const columns: ColumnDef<any>[] = [
|
|||
<span>{formatDateToIndonesian(row.getValue("createdAt"))}</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorKey: "isStaticBanner",
|
||||
header: "Static Banner",
|
||||
cell: ({ row }) => (
|
||||
<StaticToogle
|
||||
id={row.original.id}
|
||||
initChecked={row.original.isStaticBanner}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorKey: "statusName",
|
||||
header: "Status Banner",
|
||||
header: "Status Pop Up",
|
||||
cell: ({ row }) => (
|
||||
<StatusToogle id={row.original.id} initChecked={row.original.isBanner} />
|
||||
<StatusToogle id={row.original.id} initChecked={row.original.isInterstitial} />
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
id: "actions",
|
||||
accessorKey: "action",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Switch } from "@/components/ui/switch";
|
||||
import { useToast } from "@/components/ui/use-toast";
|
||||
import { useRouter } from "@/i18n/routing";
|
||||
import { setBanner } from "@/service/settings/settings";
|
||||
import { setBanner, setPopUp } from "@/service/settings/settings";
|
||||
|
||||
export default function StatusToogle(props: {
|
||||
id: number;
|
||||
|
|
@ -12,7 +12,7 @@ export default function StatusToogle(props: {
|
|||
const router = useRouter();
|
||||
|
||||
const disableBanner = async () => {
|
||||
const response = await setBanner(id, false);
|
||||
const response = await setPopUp(id, false);
|
||||
|
||||
if (response?.error) {
|
||||
toast({
|
||||
|
|
@ -25,7 +25,7 @@ export default function StatusToogle(props: {
|
|||
toast({
|
||||
title: "Success ",
|
||||
});
|
||||
router.push("/admin/settings/banner?dataChange=true");
|
||||
router.push("/admin/settings/popup?dataChange=true");
|
||||
};
|
||||
return (
|
||||
<Switch
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ export default function AdminPopup() {
|
|||
: "bg-white text-black "
|
||||
}`}
|
||||
>
|
||||
Kontent
|
||||
Konten
|
||||
</Button>
|
||||
<Button
|
||||
rounded="md"
|
||||
|
|
|
|||
Loading…
Reference in New Issue