mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-22 05:55:12 +00: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 (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 a new issue