Fixed old endpoint

Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
Florian Bouillon 2020-03-11 11:36:26 +01:00
parent 2ed6377d2d
commit b524f47a88
No known key found for this signature in database
GPG Key ID: B143FF27EF555D16

View File

@ -1,6 +1,5 @@
import { getBaseFolder } from "../util" import { getBaseFolder } from "../util"
import Category from '@tcgdex/sdk/interfaces/Category' import Category, { CategorySimple, CategoryList } from '@tcgdex/sdk/interfaces/Category'
import { categorySimple, categoryList } from "./category"
import TranslationUtil from "@tcgdex/sdk/TranslationUtil" import TranslationUtil from "@tcgdex/sdk/TranslationUtil"
import { Langs } from "@tcgdex/sdk/interfaces/LangList" import { Langs } from "@tcgdex/sdk/interfaces/LangList"
import { promises as fs } from 'fs' import { promises as fs } from 'fs'
@ -10,7 +9,7 @@ const endpoint = getBaseFolder(lang, "categories")
const btsp = async () => { const btsp = async () => {
const list: Array<categorySimple> = [] const list: Array<CategorySimple> = []
for (const cat of Object.values(Category)) { for (const cat of Object.values(Category)) {
if (typeof cat !== "number") continue if (typeof cat !== "number") continue
list.push({ list.push({
@ -19,7 +18,7 @@ const btsp = async () => {
}) })
} }
const res: categoryList = { const res: CategoryList = {
count: list.length, count: list.length,
list: list list: list
} }