From 5e868d431b431cc9f2a57efdbfa4d397e5188a3d Mon Sep 17 00:00:00 2001 From: Featyre Date: Mon, 24 Jan 2022 11:27:12 +0000 Subject: Prep for Category db work --- api/src/routes/discovery.ts | 2 +- util/src/entities/Categories.ts | 6 +----- util/src/util/Categories.ts | 1 + util/src/util/index.ts | 1 + 4 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 util/src/util/Categories.ts diff --git a/api/src/routes/discovery.ts b/api/src/routes/discovery.ts index 067dd442..6c004274 100644 --- a/api/src/routes/discovery.ts +++ b/api/src/routes/discovery.ts @@ -5,7 +5,7 @@ const router = Router(); router.get("/categories", route({}), (req: Request, res: Response) => { // TODO: - // Load categories from db instead + // Load categories from db instead of hardcoding const { locale, primary_only } = req.query; diff --git a/util/src/entities/Categories.ts b/util/src/entities/Categories.ts index 2cf89dbc..1d272118 100644 --- a/util/src/entities/Categories.ts +++ b/util/src/entities/Categories.ts @@ -15,7 +15,7 @@ import { BaseClassWithoutId } from "./BaseClass"; // }] @Entity("categories") -export class Categories extends BaseClassWithoutId { // Not using snowflake +export class CategoryEntity extends BaseClassWithoutId { // Not using snowflake @PrimaryColumn() id: number; @@ -29,8 +29,4 @@ export class Categories extends BaseClassWithoutId { // Not using snowflake @Column() is_primary: boolean; -} - -export interface DefaultCategoryValue { // TODO: Load Default Discord Categories - } \ No newline at end of file diff --git a/util/src/util/Categories.ts b/util/src/util/Categories.ts new file mode 100644 index 00000000..a3c69da7 --- /dev/null +++ b/util/src/util/Categories.ts @@ -0,0 +1 @@ +//TODO: populate default discord categories + init, get and set methods \ No newline at end of file diff --git a/util/src/util/index.ts b/util/src/util/index.ts index 98e1146c..f7a273cb 100644 --- a/util/src/util/index.ts +++ b/util/src/util/index.ts @@ -1,6 +1,7 @@ export * from "./ApiError"; export * from "./BitField"; export * from "./Token"; +//export * from "./Categories"; export * from "./cdn"; export * from "./Config"; export * from "./Constants"; -- cgit 1.4.1