diff options
| author | tamaina <tamaina@hotmail.co.jp> | 2024-02-23 18:04:30 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-23 18:04:30 +0900 |
| commit | 600d91beda206fa22cfa1c1a3f94ca9e5a0cac68 (patch) | |
| tree | 8dd8ec865956a71c077a7c86ea71980fc96a0e00 /packages/backend/src/server/api/endpoints | |
| parent | fix(backend): より多くの人に使われているハッシュタグが検... (diff) | |
| download | sharkey-600d91beda206fa22cfa1c1a3f94ca9e5a0cac68.tar.gz sharkey-600d91beda206fa22cfa1c1a3f94ca9e5a0cac68.tar.bz2 sharkey-600d91beda206fa22cfa1c1a3f94ca9e5a0cac68.zip | |
enhance: リモートのフォロワーから再度Followが来た場合、acceptを返してあげる (#13388)
* enhance: リモートのフォロワーから再度Followが来た場合、acceptを返してあげる
* nanka meccha kaeta
* ブロックチェックの後にフォロー関係の存在チェックをする
Diffstat (limited to 'packages/backend/src/server/api/endpoints')
| -rw-r--r-- | packages/backend/src/server/api/endpoints/following/create.ts | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/packages/backend/src/server/api/endpoints/following/create.ts b/packages/backend/src/server/api/endpoints/following/create.ts index ceaf32ccb2..042d7f119d 100644 --- a/packages/backend/src/server/api/endpoints/following/create.ts +++ b/packages/backend/src/server/api/endpoints/following/create.ts @@ -100,22 +100,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- throw err; }); - // Check if already following - const exist = await this.followingsRepository.exists({ - where: { - followerId: follower.id, - followeeId: followee.id, - }, - }); - - if (exist) { - throw new ApiError(meta.errors.alreadyFollowing); - } - try { await this.userFollowingService.follow(follower, followee, { withReplies: ps.withReplies }); } catch (e) { if (e instanceof IdentifiableError) { + if (e.id === 'ec3f65c0-a9d1-47d9-8791-b2e7b9dcdced') throw new ApiError(meta.errors.alreadyFollowing); if (e.id === '710e8fb0-b8c3-4922-be49-d5d93d8e6a6e') throw new ApiError(meta.errors.blocking); if (e.id === '3338392a-f764-498d-8855-db939dcf8c48') throw new ApiError(meta.errors.blocked); } |