public async Task <IActionResult> RemoveFromFavorites(PostIdDto postIdDto) { var userName = User.Identity.Name; var postId = postIdDto.Id; await favoriteService.RemoveFromFavorites(postId, userName); return(Ok(new { Result = true })); }
public async Task <IActionResult> AddToFavorites(PostIdDto postIdDto) { var userName = User.Identity.Name; var postId = postIdDto.Id; await favoriteService.AddToFavorites(postId, userName); await notificationService.FavoritesNotify(postId, userName); return(Ok(new { Result = true })); }