Skip to content
Snippets Groups Projects
Unverified Commit ea948cca authored by Kaity A's avatar Kaity A
Browse files

fix: delete old follow request (if exists) before creating new

parent 7b7de4cd
No related branches found
No related tags found
3 merge requests!449release 2024.3.1,!448Release 2023.3.1 - Codename #NotDeadYet,!440fix: delete old follow request (if exists) before creating new
Pipeline #262 passed with stage
in 1 minute and 57 seconds
...@@ -479,6 +479,12 @@ export class UserFollowingService implements OnModuleInit { ...@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment