mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
rename folder
This commit is contained in:
41
providers/saleor/utils/get-vendors.ts
Normal file
41
providers/saleor/utils/get-vendors.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { SaleorConfig } from '../api'
|
||||
|
||||
export type Brand = {
|
||||
entityId: string
|
||||
name: string
|
||||
path: string
|
||||
}
|
||||
|
||||
export type BrandEdge = {
|
||||
node: Brand
|
||||
}
|
||||
|
||||
export type Brands = BrandEdge[]
|
||||
|
||||
// TODO: Find a way to get vendors from meta
|
||||
const getVendors = async (config: SaleorConfig): Promise<BrandEdge[]> => {
|
||||
// const vendors = await fetchAllProducts({
|
||||
// config,
|
||||
// query: getAllProductVendors,
|
||||
// variables: {
|
||||
// first: 100,
|
||||
// },
|
||||
// })
|
||||
|
||||
// let vendorsStrings = vendors.map(({ node: { vendor } }) => vendor)
|
||||
|
||||
// return [...new Set(vendorsStrings)].map((v) => {
|
||||
// const id = v.replace(/\s+/g, '-').toLowerCase()
|
||||
// return {
|
||||
// node: {
|
||||
// entityId: id,
|
||||
// name: v,
|
||||
// path: `brands/${id}`,
|
||||
// },
|
||||
// }
|
||||
// })
|
||||
|
||||
return []
|
||||
}
|
||||
|
||||
export default getVendors
|
Reference in New Issue
Block a user