public ActionResult <IEnumerable <Keep> > GetKeepByUser()
 {
     try
     {
         var uId = HttpContext.User.FindFirstValue("Id");
         return(Ok(_repo.GetKeepsByUser(uId)));
         // return (uId);
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Exemple #2
0
 public ActionResult <IEnumerable <Keep> > Get(string user)
 {
     try
     {
         var userId = HttpContext.User.FindFirstValue("Id");
         // value.UserId = userId;
         if (userId == null)
         {
             throw new Exception("Login In To Get Your Keeps");
         }
         // value.something = something;
         return(Ok(_repo.GetKeepsByUser(userId)));
     }
     catch (Exception e)
     {
         return(BadRequest(e));
     }
 }