import apiClient from './axios';
import store from '../store'; 

const loadMenu = async () => {
    try {
        const userId = store.getters.user ? store.getters.user.id : null;
        if (!userId) {
            throw new Error('User ID not found');
        }
        const response = await apiClient.get('/api/navigation/' + userId);
        return response.data;
    } catch (err) {
        return [];
    }
};

export default loadMenu;
