import { Menu } from '@/payload-types' export const fetchMenu = async (): Promise => { const rep = await fetch( "http://localhost:3000/api/globals/menu", { next: { tags: ['menu'] } } // cache fetch result ); if (!rep.ok) { throw new Error("Could not fetch menu") } return await rep.json() }