TastyBites/front/src/lib/api.js
deepsource-autofix[bot] cd6fdf3b29
style: format code with Prettier
This commit fixes the style issues introduced in 6e31b44 according to the output
from Prettier.

Details: None
2024-05-04 15:26:36 +00:00

29 lines
569 B
JavaScript

import TestData from "%/lib/test-data.ts";
export async function getPopularToday() {
const res = await fetch("/api/items");
const data = res.json();
if (res.ok) {
return data;
} else {
throw new Error("Failed to fetch popular today");
}
}
export function getMenuItems() {
return [
{
name: "Main Menu",
items: TestData,
},
{
name: "Breakfast",
items: [],
},
{
name: "Seasonal",
items: TestData,
},
];
}