commerce/framework/kibocommerce/api/operations/get-all-product-paths.ts
kibo-chandradeeptalaha 9e92abdda0
Icky 161 folder and env setup (#1)
* folder and env setup

* codegen.json headers removed

Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>
2021-08-24 08:45:14 -05:00

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
}