fix: delete old follow request (if exists) before creating new
This commit is contained in:
parent
7b7de4cdb3
commit
ea948ccadc
@ -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 New Issue
Block a user