16 lines
706 B
JavaScript
16 lines
706 B
JavaScript
import apiService from '../APIRequestService/APIService';
|
|
|
|
export const fetchMenuItems = async () => {
|
|
console.log("Entering fetchMenuItems"); // Log to confirm function call
|
|
const apiUrl = '/fndMenu/menuloadbyuser'; // Keep it relative as the base URL is already handled in apiService
|
|
|
|
try {
|
|
const data = await apiService.get(apiUrl); // Use the common apiService's GET method
|
|
console.log("API response data:", data); // Log response data
|
|
|
|
return data;
|
|
} catch (error) {
|
|
console.error("Error fetching menu items:", error); // Log the error if any
|
|
throw error; // Re-throw to handle it in the component or wherever the function is called
|
|
}
|
|
}; |