cleanup, add sorting

This commit is contained in:
Greg Hoskin
2021-04-25 14:20:58 -05:00
parent 6a9c6c3bca
commit a409c373c4
52 changed files with 74 additions and 618 deletions

View File

@@ -1,7 +1,4 @@
import { swellConfig } from '@framework'
import { getConfig, SwellConfig } from '../api'
import fetchAllProducts from '../api/utils/fetch-all-products'
import getAllProductVendors from './queries/get-all-product-vendors-query'
import { SwellConfig } from '../api'
export type BrandNode = {
name: string
@@ -15,8 +12,8 @@ export type BrandEdge = {
export type Brands = BrandEdge[]
const getVendors = async (config: SwellConfig) => {
const vendors =
(await config.fetchSwell('attributes', 'get', ['brand']).values) ?? []
const vendors: [string] =
(await config.fetchSwell('attributes', 'get', ['brand'])).values ?? []
return [...new Set(vendors)].map((v) => ({
node: {