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 (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 New Issue