mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-25 09:25:12 +00:00
fix(backend): フォローリクエストを作成する際に既存のものは削除するように (#13588)
* fix: delete old follow request (if exists) before creating new
(cherry picked from commit ea948ccadc
)
* Update Changelog
* Update Changelog
---------
Co-authored-by: Kaity A <kaity@atikayda.au>
This commit is contained in:
parent
b65203c9f8
commit
a38646bd0f
2 changed files with 8 additions and 0 deletions
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
- Enhance: エンドポイント`antennas/update`の必須項目を`antennaId`のみに
|
- Enhance: エンドポイント`antennas/update`の必須項目を`antennaId`のみに
|
||||||
|
- Fix: フォローリクエストを作成する際に既存のものは削除するように
|
||||||
|
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/440)
|
||||||
|
|
||||||
## 2024.3.1
|
## 2024.3.1
|
||||||
|
|
||||||
|
|
|
@ -511,6 +511,12 @@ export class UserFollowingService implements OnModuleInit {
|
||||||
if (blocking) throw new Error('blocking');
|
if (blocking) throw new Error('blocking');
|
||||||
if (blocked) throw new Error('blocked');
|
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({
|
const followRequest = await this.followRequestsRepository.insert({
|
||||||
id: this.idService.gen(),
|
id: this.idService.gen(),
|
||||||
followerId: follower.id,
|
followerId: follower.id,
|
||||||
|
|
Loading…
Reference in a new issue