mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-13 17:30:45 +01:00
fix: delete old follow request (if exists) before creating new
This commit is contained in:
parent
7b7de4cdb3
commit
ea948ccadc
1 changed files with 6 additions and 0 deletions
|
@ -479,6 +479,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 a new issue