mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-09-09 04:31:59 +03:00
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 a new issue