Fix build errors

This commit is contained in:
cond0r
2021-05-13 16:10:09 +03:00
parent e7d0f56e85
commit bff94e73ae
22 changed files with 87 additions and 458 deletions

View File

@@ -1,15 +1,15 @@
import { SwellConfig } from '../api'
export type Category = {
id: string
entityId: string
name: string
slug: string
path: string
}
const getCategories = async (config: SwellConfig): Promise<Category[]> => {
const data = await config.fetchSwell('categories', 'get')
const data = await config.fetch('categories', 'get')
return (
data.results.map(({ id: entityId, name, slug }: Category) => ({
data.results.map(({ id: entityId, name, slug }: any) => ({
entityId,
name,
path: `/${slug}`,