mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 07:26:59 +00:00
* new SFCC provider * add search * normalization + search * categories as search results * adress PR feedback * Update README.md * get all paths for SSG * product variants and options * Apply suggestions from code review Co-authored-by: Luis Alvarez D. <luis@vercel.com> * remove console log * prettier * clean console log * ran prettier * Updated readme * remove static data and revert config changes * set default site Co-authored-by: Luis Alvarez D. <luis@vercel.com>
18 lines
424 B
TypeScript
18 lines
424 B
TypeScript
import { Fetcher } from '@vercel/commerce/utils/types'
|
|
|
|
const clientFetcher: Fetcher = async ({ method, url, body }) => {
|
|
const response = await fetch(url!, {
|
|
method,
|
|
body: body ? JSON.stringify(body) : undefined,
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
})
|
|
.then((response) => response.json())
|
|
.then((response) => response.data)
|
|
|
|
return response
|
|
}
|
|
|
|
export default clientFetcher
|