mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-23 04:13:09 +02:00
merge: fix: delete old follow request (if exists) before creating new (!440)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/440 Approved-by: dakkar <dakkar@thenautilus.net> Approved-by: Marie <marie@kaifa.ch>
This commit is contained in:
commit
1b65c06d60
1 changed files with 6 additions and 0 deletions
|
@ -520,6 +520,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