mirror of
https://github.com/vercel/commerce.git
synced 2025-07-30 05:31:22 +00:00
.vscode
assets
components
config
framework
bigcommerce
commerce
local
api
endpoints
operations
get-all-pages.ts
get-all-product-paths.ts
get-all-products.ts
get-customer-wishlist.ts
get-page.ts
get-product.ts
get-site-info.ts
index.ts
utils
index.ts
auth
cart
customer
product
wishlist
.env.template
README.md
commerce.config.json
data.json
fetcher.ts
index.tsx
next.config.js
provider.ts
shopify
swell
vendure
lib
pages
public
.editorconfig
.env.template
.gitignore
.prettierignore
.prettierrc
README.md
codegen.json
commerce.config.json
global.d.ts
license.md
next-env.d.ts
next.config.js
package-lock.json
package.json
postcss.config.js
tailwind.config.js
tsconfig.json
yarn.lock
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
|
|
}
|