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 }
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()); }
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)); } }
public IEnumerable <Keep> GetKeepsByVault(int vaultId) { return(_repo.GetKeepsByVaultId(vaultId)); }
public IEnumerable <VaultKeepViewModel> GetKeepsByVaultId(string userId, int vaultId) { return(_repo.GetKeepsByVaultId(userId, vaultId)); }