Exemple #1
0
        public async Task <ActionResult <string> > DeleteVaultKeep(int id)
        {
            try
            {
                Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>();

                return(Ok(_service.DeleteVaultKeep(id, userInfo.Id)));
            }
            catch (System.Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Exemple #2
0
 public ActionResult <VaultKeep> Put([FromBody] VaultKeep oldVaultKeep)
 {
     try
     {
         oldVaultKeep.UserId = HttpContext.User.FindFirstValue("Id");
         _service.DeleteVaultKeep(oldVaultKeep);
         return(Ok("Delete successful"));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Exemple #3
0
 public ActionResult<VaultKeep> DeleteVaultKeep([FromBody] VaultKeep toRemove)
 {
   try
   {
     string userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
     toRemove.UserId = userId;
     return Ok(_vks.DeleteVaultKeep(toRemove));
   }
   catch (Exception e)
   {
     return BadRequest(e.Message);
   }
 }