예제 #1
0
        public ActionResult <IEnumerable <Keep> > GetUserKeeps()
        {
            var id   = HttpContext.User.FindFirstValue("Id");
            var user = _userRepo.GetUserById(id);

            if (user != null)
            {
                return(Ok(_keepRepo.GetKeepsByUser(id)));
            }

            return(BadRequest());
        }
예제 #2
0
 public ActionResult <IEnumerable <Keep> > GetKeepsByUser(string userId)
 {
     try
     {
         var uid = HttpContext.User.FindFirstValue("Id");
         userId = uid;
         return(Ok(_repo.GetKeepsByUser(userId)));
     }
     catch (Exception e)
     {
         return(BadRequest(e));
     }
 }
예제 #3
0
        public ActionResult <IEnumerable <Keep> > GetByUser()
        {
            string             userId    = HttpContext.User.FindFirstValue("Id");
            IEnumerable <Keep> userKeeps = _repo.GetKeepsByUser(userId);

            try
            {
                return(Ok(userKeeps));
            }
            catch (Exception e)
            {
                return(BadRequest(e));
            }
        }