mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 18:52:56 +00:00
dev day #100 - WE ARE FUCKING DONE, hotfixes incoming but we did it in 100 days, lets fucking go guys, anyone reading this...i love you
This commit is contained in:
@@ -16,6 +16,7 @@ export interface NavigationItem {
|
||||
css_class?: string;
|
||||
requires_auth?: boolean;
|
||||
requires_admin?: boolean;
|
||||
allow_editor?: boolean;
|
||||
}
|
||||
|
||||
export interface SocialLink {
|
||||
@@ -50,6 +51,7 @@ function normalizeNavItem(raw: any): NavigationItem {
|
||||
css_class: raw.css_class,
|
||||
requires_auth: raw.requires_auth,
|
||||
requires_admin: raw.requires_admin,
|
||||
allow_editor: raw.allow_editor,
|
||||
} as NavigationItem;
|
||||
}
|
||||
|
||||
@@ -104,6 +106,13 @@ export const reorderNavigationItems = async (orders: { id: number; display_order
|
||||
await api.post(`/admin/navigation/reorder`, orders);
|
||||
};
|
||||
|
||||
// Editor-allowed admin navigation (for editors' sidebar)
|
||||
export const getEditorAllowedAdminNav = async (): Promise<NavigationItem[]> => {
|
||||
const response = await api.get(`/admin/navigation/editor`);
|
||||
const data = Array.isArray(response.data) ? response.data : [];
|
||||
return data.map((it: any) => normalizeNavItem(it));
|
||||
};
|
||||
|
||||
// Social links admin endpoints
|
||||
export const getAllSocialLinks = async (): Promise<SocialLink[]> => {
|
||||
const response = await api.get(`/admin/social-links`);
|
||||
|
||||
Reference in New Issue
Block a user