diff options
Diffstat (limited to 'src/util/connections')
-rw-r--r-- | src/util/connections/Connection.ts | 4 | ||||
-rw-r--r-- | src/util/connections/ConnectionConfig.ts | 1 | ||||
-rw-r--r-- | src/util/connections/ConnectionLoader.ts | 7 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/util/connections/Connection.ts b/src/util/connections/Connection.ts index 02104d39..e8d41c36 100644 --- a/src/util/connections/Connection.ts +++ b/src/util/connections/Connection.ts @@ -1,7 +1,7 @@ import crypto from "crypto"; import { ConnectedAccount } from "../entities"; import { OrmUtils } from "../imports"; -import { ConnectionCallbackSchema } from "../schemas"; +import { ConnectedAccountSchema, ConnectionCallbackSchema } from "../schemas"; import { DiscordApiErrors } from "../util"; export default abstract class Connection { @@ -54,7 +54,7 @@ export default abstract class Connection { this.states.delete(state); } - async createConnection(data: any): Promise<void> { + async createConnection(data: ConnectedAccountSchema): Promise<void> { const ca = OrmUtils.mergeDeep(new ConnectedAccount(), data); await ca.save(); } diff --git a/src/util/connections/ConnectionConfig.ts b/src/util/connections/ConnectionConfig.ts index 9b120c93..dd372ff7 100644 --- a/src/util/connections/ConnectionConfig.ts +++ b/src/util/connections/ConnectionConfig.ts @@ -21,7 +21,6 @@ export const ConnectionConfig = { set: function set(val: Partial<any>) { if (!config || !val) return; config = val.merge(config); - console.debug("config", config); // TODO: if no more issues with sql, remove this or find the reason why it's happening return applyConfig(config); }, diff --git a/src/util/connections/ConnectionLoader.ts b/src/util/connections/ConnectionLoader.ts index d06a6446..7467739c 100644 --- a/src/util/connections/ConnectionLoader.ts +++ b/src/util/connections/ConnectionLoader.ts @@ -23,7 +23,6 @@ export class ConnectionLoader { dirs.forEach(async (x) => { let modPath = path.resolve(path.join(root, x)); - console.log(`Loading connection: ${modPath}`); const mod = new (require(modPath).default)() as Connection; ConnectionStore.connections.set(mod.id, mod); @@ -55,11 +54,13 @@ export class ConnectionLoader { console.log( `[ConnectionConfig/WARN] ${id} tried to set config=null!`, ); - await ConnectionConfig.set({ + + const a = { [id]: OrmUtils.mergeDeep( ConnectionLoader.getConnectionConfig(id) || {}, config, ), - }); + }; + await ConnectionConfig.set(a); } } |