summary refs log tree commit diff
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-08 20:53:15 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-09 23:28:27 +0200
commit3c624cc95a991ccaffe62694e698de4020d48e35 (patch)
tree4de0c05e61a1ebe30ca990af4e0fcb60e1d695b7
parentBunch of fixes and improvements, everything appears to work now (diff)
downloadserver-3c624cc95a991ccaffe62694e698de4020d48e35.tar.xz
Clean up BaseClient assign call
-rw-r--r--util/src/entities/BaseClass.ts31
1 files changed, 3 insertions, 28 deletions
diff --git a/util/src/entities/BaseClass.ts b/util/src/entities/BaseClass.ts
index 1ab75a5a..c872e7f1 100644
--- a/util/src/entities/BaseClass.ts
+++ b/util/src/entities/BaseClass.ts
@@ -3,32 +3,8 @@ import { BaseEntity, EntityMetadata, ObjectIdColumn, PrimaryColumn, FindOptionsW
 import { Snowflake } from "../util/Snowflake";
 
 export class BaseClassWithoutId extends BaseEntity {
-	constructor(props?: any) {
+	constructor() {
 		super();
-		if(props != undefined && props != null && Object.keys(props).length > 0)
-			this.assign(props);
-	}
-
-	assign(props: any = {}) {
-		//console.log(`assign (${typeof this})...`)
-		delete props.opts;
-		delete props.props;
-		// will not include relational properties
-		console.warn("WARNING: BaseClass.assign called! This will probably fail!");
-		console.warn(this)
-		Object.assign(this,props);
-		if(/--debug|--inspect/.test(process.execArgv.join(' '))) debugger;
-		/*for (const key in props) {
-			// @ts-ignore
-			const setter = this[`set${key.capitalize()}`]; // use setter function if it exists
-
-			if (setter) {
-				setter.call(this, props[key]);
-			} else {
-				// @ts-ignore
-				this[key] = props[key];
-			}
-		}*/
 	}
 }
 
@@ -38,10 +14,9 @@ export class BaseClass extends BaseClassWithoutId {
 	@PrimaryIdColumn()
 	id: string;
 
-	assign(props: any = {}) {
-			super.assign(props);
+	constructor() {
+		super();
 		if (!this.id) this.id = Snowflake.generate();
-		return this;
 	}
 
 	save(options?: SaveOptions | undefined): Promise<this> {