public HttpResponseMessage SelectByBounds(BoundSearchRequest bounds)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            BaseResponse   rsp;
            HttpStatusCode httpStatus;
            string         userId = _userService.GetCurrentUserId();

            if (userId != null)
            {
                rsp        = new ItemsResponse <Domain.Follower.Follower>(_followerSevice.GetFollowers(userId, bounds));
                httpStatus = HttpStatusCode.OK;
            }
            else
            {
                rsp        = new ErrorResponse("Forbidden. User not found");
                httpStatus = HttpStatusCode.Forbidden;
            }
            return(Request.CreateResponse(httpStatus, rsp));
        }
Example #2
0
 public ActionResult <List <Follower> > Get(string id, int queryDepth)
 {
     return(_followerService.GetFollowers(id, queryDepth));
 }
Example #3
0
 public async Task <IActionResult> GetFollowers([FromRoute] string username)
 {
     return(await _followerService.GetFollowers(username));
 }