mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 15:36:58 +00:00
12 lines
249 B
TypeScript
12 lines
249 B
TypeScript
import { Fetcher } from '@commerce/utils/types'
|
|
|
|
export const fetcher: Fetcher = async () => {
|
|
console.log('FETCHER')
|
|
const res = await fetch('./data.json')
|
|
if (res.ok) {
|
|
const { data } = await res.json()
|
|
return data
|
|
}
|
|
throw res
|
|
}
|