added login, first preparation for menu

This commit is contained in:
Torsten Schulz
2024-07-21 13:09:56 +02:00
parent bbf4a2deb3
commit 597761cb15
10 changed files with 391 additions and 100 deletions

View File

@@ -0,0 +1,19 @@
import axios from 'axios';
import store from '../store';
const loadMenu = async () => {
try {
console.log(store.getters.user);
const userId = store.getters.user ? store.getters.user.id : null;
if (!userId) {
throw new Error('User ID not found');
}
const response = await axios.get('/api/navigation/' + userId);
return response.data;
} catch (err) {
console.error(err);
return [];
}
};
export default loadMenu;