diff --git a/frontend/app/(auth)/dashboard/blogs/page.tsx b/frontend/app/(auth)/dashboard/blogs/page.tsx index c235f96..f9a2606 100644 --- a/frontend/app/(auth)/dashboard/blogs/page.tsx +++ b/frontend/app/(auth)/dashboard/blogs/page.tsx @@ -11,7 +11,7 @@ export default async function Page() { me.status === "Error" || !me.data || !hasPermissions(me.data.roles, { - events: ["get"], + blogs: ["get"], }) ) { redirect("/dashboard"); diff --git a/frontend/components/planning.tsx b/frontend/components/planning.tsx index 4500392..41954cc 100644 --- a/frontend/components/planning.tsx +++ b/frontend/components/planning.tsx @@ -8,7 +8,11 @@ import { createEventsServicePlugin } from "@schedule-x/events-service"; import { createDragAndDropPlugin } from "@schedule-x/drag-and-drop"; import { createResizePlugin } from "@schedule-x/resize"; import { createEventRecurrencePlugin } from "@schedule-x/event-recurrence"; -import { createViewDay, createViewWeek } from "@schedule-x/calendar"; +import { + createViewDay, + createViewWeek, + PluginBase, +} from "@schedule-x/calendar"; import { useEffect, useState } from "react"; import { format } from "date-fns"; import { Dialog, DialogProps } from "@radix-ui/react-dialog"; @@ -29,6 +33,8 @@ import { UseFormReturn } from "react-hook-form"; import mapFrequencyToRrule from "@/lib/mapFrequencyToRrule"; import { useToast } from "@/hooks/use-toast"; +type Plugins = PluginBase[]; + const Planning: React.FC<{ events: ICalendarEvent[]; mutate?: KeyedMutator>; @@ -37,15 +43,14 @@ const Planning: React.FC<{ const { toast } = useToast(); const { resolvedTheme } = useTheme(); const isConnected = getCookie("auth_token"); - const plugins = - isConnected && modifiable - ? [ - createEventsServicePlugin(), - createDragAndDropPlugin(), - createResizePlugin(), - createEventRecurrencePlugin(), - ] - : []; + const plugins: Plugins = [ + createEventsServicePlugin(), + createEventRecurrencePlugin(), + ]; + if (isConnected && modifiable) { + plugins.push(createDragAndDropPlugin()); + plugins.push(createResizePlugin()); + } const [eventSelected, setEventSelected] = useState( null, );