mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 07:26:59 +00:00
16 lines
373 B
TypeScript
16 lines
373 B
TypeScript
import data from '../../data.json'
|
|
|
|
export type GetAllProductPathsResult = {
|
|
products: Array<{ path: string }>
|
|
}
|
|
|
|
export default function getAllProductPathsOperation() {
|
|
function getAllProductPaths(): Promise<GetAllProductPathsResult> {
|
|
return Promise.resolve({
|
|
products: data.products.map(({ path }) => ({ path })),
|
|
})
|
|
}
|
|
|
|
return getAllProductPaths
|
|
}
|