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
|
@ -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…
Add table
Add a link
Reference in a new issue