public async Task <IActionResult> UnFollowUser([FromBody] UnfollowUserRequest unfollowUser)
        {
            JsonResponse <string> objResult = new JsonResponse <string>();

            try
            {
                bool unfollowed = await this._settingService.UnFollowUser(unfollowUser);

                if (unfollowed)
                {
                    objResult.Data    = StaticResource.Unfollowed;
                    objResult.Status  = StaticResource.SuccessStatusCode;
                    objResult.Message = StaticResource.SuccessMessage;
                    return(new OkObjectResult(objResult));
                }
            }
            catch (Exception ex)
            {
                HttpContext.RiseError(ex);
                objResult.Data    = ex.Message;
                objResult.Status  = StaticResource.FailStatusCode;
                objResult.Message = StaticResource.FailMessage;
            }
            return(new OkObjectResult(objResult));
        }
Example #2
0
 public async Task <bool> UnFollowUser(UnfollowUserRequest unfollowUser)
 {
     try
     {
         return(await this._settingsRepo.UnFollowUser(unfollowUser));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public async Task <bool> UnFollowUser(UnfollowUserRequest unfollowUser)
        {
            try
            {
                UserFollower userFollower = await this.therapistContext.UserFollower.FirstOrDefaultAsync(x => x.UserId.Equals(unfollowUser.userId) && x.UserFollowerId.Equals(unfollowUser.userFollowerId));

                userFollower.IsActive     = false;
                userFollower.IsDeleted    = true;
                userFollower.ModifiedDate = DateTime.UtcNow;
                userFollower.ModifiedBy   = unfollowUser.userId;
                await this.therapistContext.SaveChangesAsync();

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public void UnfollowUser(UnfollowUserRequest unfollowUserRequest)
 {
     SendRequest(unfollowUserRequest.ToXML());
 }