Starting to implement permissions into frontend

This commit is contained in:
cdricms
2025-01-30 15:50:58 +01:00
parent 8d2214e5dd
commit 0e707e8721
16 changed files with 715 additions and 35 deletions

View File

@@ -12,6 +12,7 @@ import {
Calendar,
Loader2,
Camera,
UserRoundCog,
} from "lucide-react";
import { NavMain } from "@/components/nav-main";
@@ -103,6 +104,11 @@ const data = {
url: "/dashboard/settings/shortcodes",
icon: Camera,
},
{
title: "Rôles et Permissions",
url: "/dashboard/settings/roles",
icon: UserRoundCog,
},
],
},
],

View File

@@ -58,10 +58,7 @@ const Planning: React.FC<{
csrfToken: false,
});
if (res.status === "Error") {
console.log("Error");
}
if (res.status === "Success") {
calendar?.events?.update(eventSelected);
// calendar?.events?.update(oldEvent);
}
} catch (e) {
console.log(e);
@@ -89,9 +86,12 @@ const Planning: React.FC<{
onEventClick(event, e) {
setEventSelected(event);
},
async onEventUpdate(event) {
console.log(event);
await handleEventUpdate(event);
// async onBeforeEventUpdate(oldEvent, newEvent) {
// await request("/api/me/has-permissions")
// },
async onEventUpdate(newEvent) {
// console.log(event);
await handleEventUpdate(newEvent);
},
},
},