From 869804e16aee0beea35aa4e5925cfec901956fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <michael@minelli.me> Date: Fri, 2 Jun 2023 14:14:53 +0200 Subject: [PATCH] UserModel => Add User table name --- ExpressAPI/src/models/Model.ts | 2 +- ExpressAPI/src/models/User.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ExpressAPI/src/models/Model.ts b/ExpressAPI/src/models/Model.ts index 2e742a0..fdb0618 100644 --- a/ExpressAPI/src/models/Model.ts +++ b/ExpressAPI/src/models/Model.ts @@ -8,7 +8,7 @@ abstract class Model extends Object { const result = new this(); Object.getOwnPropertyNames(obj).forEach(property => { - if (result.hasOwnProperty(property)) { + if ( result.hasOwnProperty(property) ) { (result as any)[property] = obj[property]; } }); diff --git a/ExpressAPI/src/models/User.ts b/ExpressAPI/src/models/User.ts index d81782d..65e5b37 100644 --- a/ExpressAPI/src/models/User.ts +++ b/ExpressAPI/src/models/User.ts @@ -7,6 +7,8 @@ import db from '../helpers/DatabaseHelper'; class User extends Model { + static tableName: string = 'Users'; + userID: number = null; userFirstName: string = ''; userLastName: string = ''; -- GitLab