styling ui header menu

This commit is contained in:
2026-02-05 00:04:28 +07:00
parent 00ba842b80
commit c98ccd1fa1
8 changed files with 99 additions and 135 deletions

View File

@@ -0,0 +1,20 @@
import axiosInstance from '../lib/axios';
import { HeaderMenu } from '../types/header-menu';
export const headerMenuService = {
/**
* Fetch active header menu tree from API
*/
async getHeaderMenu(): Promise<HeaderMenu[]> {
try {
const response = await axiosInstance.get<{ success: boolean; data: HeaderMenu[] }>('/api/header-menu');
if (response.data.success) {
return response.data.data;
}
return [];
} catch (error) {
console.error('Failed to fetch header menu:', error);
return []; // Fallback to empty menu
}
}
};