diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-12-23 12:44:04 +1100 |
---|---|---|
committer | Puyodead1 <puyodead@proton.me> | 2023-03-18 19:23:20 -0400 |
commit | a4961800d7b6b37864b7b7c44893c734ef1b05ae (patch) | |
tree | c633c3de4d901e3ac5e4742220d06874a5702810 /src/util/connections/Connection.ts | |
parent | implement PATCH connection (diff) | |
download | server-a4961800d7b6b37864b7b7c44893c734ef1b05ae.tar.xz |
`handleCallback` returns connection if created for `USER_CONNECTIONS_UPDATE`
Diffstat (limited to 'src/util/connections/Connection.ts')
-rw-r--r-- | src/util/connections/Connection.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/util/connections/Connection.ts b/src/util/connections/Connection.ts index e8d41c36..164cfac7 100644 --- a/src/util/connections/Connection.ts +++ b/src/util/connections/Connection.ts @@ -21,7 +21,7 @@ export default abstract class Connection { * Processes the callback * @param args Callback arguments */ - abstract handleCallback(params: ConnectionCallbackSchema): Promise<boolean>; + abstract handleCallback(params: ConnectionCallbackSchema): Promise<ConnectedAccount | null>; /** * Gets a user id from state @@ -54,9 +54,10 @@ export default abstract class Connection { this.states.delete(state); } - async createConnection(data: ConnectedAccountSchema): Promise<void> { - const ca = OrmUtils.mergeDeep(new ConnectedAccount(), data); + async createConnection(data: ConnectedAccountSchema): Promise<ConnectedAccount> { + const ca = OrmUtils.mergeDeep(new ConnectedAccount(), data) as ConnectedAccount; await ca.save(); + return ca; } async hasConnection(userId: string, externalId: string): Promise<boolean> { |