From d7635eff54d78494faf5f7ae26da0ce9f0c4a4e8 Mon Sep 17 00:00:00 2001 From: chachopacho Date: Fri, 15 Oct 2021 15:06:02 -0300 Subject: [PATCH] Fix Errors on Register & getProduct (string -> number) --- app/server/classes/DataBase.ts | 2 +- app/server/classes/ProductsAPI.ts | 2 +- app/server/classes/UsersAPI.ts | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/server/classes/DataBase.ts b/app/server/classes/DataBase.ts index dd937ad..9f8c7af 100644 --- a/app/server/classes/DataBase.ts +++ b/app/server/classes/DataBase.ts @@ -42,6 +42,6 @@ export default class DataBase extends Filter { } private returnConfig(): any { - return this.returnTable(this.getTablePath("config")); + return this.returnTable("config"); } } diff --git a/app/server/classes/ProductsAPI.ts b/app/server/classes/ProductsAPI.ts index 5623e33..279e57c 100644 --- a/app/server/classes/ProductsAPI.ts +++ b/app/server/classes/ProductsAPI.ts @@ -48,6 +48,6 @@ export default class ProductsAPI extends DataBase { public getProduct(): Product { const { id } = this.params; - return this.products.find((product: any) => product.id === id); + return this.products.find((product: any) => product.id === +id); } } diff --git a/app/server/classes/UsersAPI.ts b/app/server/classes/UsersAPI.ts index 4403e50..32184c0 100644 --- a/app/server/classes/UsersAPI.ts +++ b/app/server/classes/UsersAPI.ts @@ -36,6 +36,8 @@ export default class UsersAPI extends DataBase { id: config.maxID, }); + this.setTable("users", this.users); + return config.maxID; }