fix(backend): フォローリクエストを作成する際に既存のものは削除するように (#13588)
* fix: delete old follow request (if exists) before creating new (cherry picked from commit ea948ccadc7eace1fcace176c9c070b2a9b46f56) * Update Changelog * Update Changelog --------- Co-authored-by: Kaity A <kaity@atikayda.au>
This commit is contained in:
parent
b65203c9f8
commit
a38646bd0f
@ -18,6 +18,8 @@
|
||||
|
||||
### Server
|
||||
- Enhance: エンドポイント`antennas/update`の必須項目を`antennaId`のみに
|
||||
- Fix: フォローリクエストを作成する際に既存のものは削除するように
|
||||
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/440)
|
||||
|
||||
## 2024.3.1
|
||||
|
||||
|
@ -511,6 +511,12 @@ export class UserFollowingService implements OnModuleInit {
|
||||
if (blocking) throw new Error('blocking');
|
||||
if (blocked) throw new Error('blocked');
|
||||
|
||||
// Remove old follow requests before creating a new one.
|
||||
await this.followRequestsRepository.delete({
|
||||
followeeId: followee.id,
|
||||
followerId: follower.id,
|
||||
});
|
||||
|
||||
const followRequest = await this.followRequestsRepository.insert({
|
||||
id: this.idService.gen(),
|
||||
followerId: follower.id,
|
||||
|
Loading…
Reference in New Issue
Block a user