Ejemplo n.º 1
0
        public ActionResult <IEnumerable <VaultKeep> > GetKeepsByVaultId(int vaultId)
        {
            var uId = HttpContext.User.Identity.Name;

            return(Ok(_repo.GetKeepsByVaultId(vaultId, uId)));
            // return list of vaultkeeps with the userID and VaultID
        }
Ejemplo n.º 2
0
        public ActionResult <IEnumerable <Keep> > Get(int id)
        {
            var userId = HttpContext.User.Identity.Name;
            IEnumerable <Keep> result = _vaultKeepRepo.GetKeepsByVaultId(id, userId);

            if (result != null)
            {
                return(Ok(result));
            }
            return(BadRequest());
        }
Ejemplo n.º 3
0
        public ActionResult <IEnumerable <Keep> > Get(int vaultId)
        {
            try
            {
                var userId = HttpContext.User.FindFirstValue("Id"); // THIS IS HOW YOU GET THE ID of the currently logged in user

                return(Ok(_repo.GetKeepsByVaultId(vaultId, userId)));
            }
            catch (Exception e)
            {
                return(BadRequest(e));
            }
        }
Ejemplo n.º 4
0
 public IEnumerable <Keep> GetKeepsByVault(int vaultId)
 {
     return(_repo.GetKeepsByVaultId(vaultId));
 }
Ejemplo n.º 5
0
 public IEnumerable <VaultKeepViewModel> GetKeepsByVaultId(string userId, int vaultId)
 {
     return(_repo.GetKeepsByVaultId(userId, vaultId));
 }