diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-03-26 15:34:00 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-26 15:34:00 +0900 |
| commit | 1c67c26bd87aae64fe0f2ef45140e12a78564699 (patch) | |
| tree | 633a3fad1c5841ea20bc39d6b681b455bbdeabf3 /packages/backend/src/server/api/stream | |
| parent | .js (diff) | |
| download | sharkey-1c67c26bd87aae64fe0f2ef45140e12a78564699.tar.gz sharkey-1c67c26bd87aae64fe0f2ef45140e12a78564699.tar.bz2 sharkey-1c67c26bd87aae64fe0f2ef45140e12a78564699.zip | |
refactor: migrate to typeorm 3.0 (#8443)
* wip
* wip
* wip
* Update following.ts
* wip
* wip
* wip
* Update resolve-user.ts
* maxQueryExecutionTime
* wip
* wip
Diffstat (limited to 'packages/backend/src/server/api/stream')
3 files changed, 6 insertions, 6 deletions
diff --git a/packages/backend/src/server/api/stream/channels/messaging.ts b/packages/backend/src/server/api/stream/channels/messaging.ts index 94bbdeca52..877d44c38e 100644 --- a/packages/backend/src/server/api/stream/channels/messaging.ts +++ b/packages/backend/src/server/api/stream/channels/messaging.ts @@ -26,12 +26,12 @@ export default class extends Channel { public async init(params: any) { this.otherpartyId = params.otherparty; - this.otherparty = this.otherpartyId ? await Users.findOneOrFail({ id: this.otherpartyId }) : null; + this.otherparty = this.otherpartyId ? await Users.findOneByOrFail({ id: this.otherpartyId }) : null; this.groupId = params.group; // Check joining if (this.groupId) { - const joining = await UserGroupJoinings.findOne({ + const joining = await UserGroupJoinings.findOneBy({ userId: this.user!.id, userGroupId: this.groupId, }); @@ -72,7 +72,7 @@ export default class extends Channel { // リモートユーザーからのメッセージだったら既読配信 if (Users.isLocalUser(this.user!) && Users.isRemoteUser(this.otherparty!)) { - MessagingMessages.findOne(body.id).then(message => { + MessagingMessages.findOneBy({ id: body.id }).then(message => { if (message) deliverReadActivity(this.user as ILocalUser, this.otherparty as IRemoteUser, message); }); } diff --git a/packages/backend/src/server/api/stream/channels/user-list.ts b/packages/backend/src/server/api/stream/channels/user-list.ts index 57523c8488..d8034e83fe 100644 --- a/packages/backend/src/server/api/stream/channels/user-list.ts +++ b/packages/backend/src/server/api/stream/channels/user-list.ts @@ -23,7 +23,7 @@ export default class extends Channel { this.listId = params.listId as string; // Check existence and owner - const list = await UserLists.findOne({ + const list = await UserLists.findOneBy({ id: this.listId, userId: this.user!.id, }); diff --git a/packages/backend/src/server/api/stream/index.ts b/packages/backend/src/server/api/stream/index.ts index 0cb38e2a99..b803478281 100644 --- a/packages/backend/src/server/api/stream/index.ts +++ b/packages/backend/src/server/api/stream/index.ts @@ -188,7 +188,7 @@ export default class Connection { */ private async onApiRequest(payload: any) { // 新鮮なデータを利用するためにユーザーをフェッチ - const user = this.user ? await Users.findOne(this.user.id) : null; + const user = this.user ? await Users.findOneBy({ id: this.user.id }) : null; const endpoint = payload.endpoint || payload.ep; // alias @@ -386,7 +386,7 @@ export default class Connection { } private async updateUserProfile() { - this.userProfile = await UserProfiles.findOne({ + this.userProfile = await UserProfiles.findOneBy({ userId: this.user!.id, }); } |