Пример #1
0
 public ActionResult <VaultKeep> Post([FromBody] VaultKeep newVaultKeep)
 {
     try
     {
         var userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
         newVaultKeep.UserId = userId;
         int  updateId = newVaultKeep.KeepId;
         int  vaultId  = newVaultKeep.VaultId;
         Keep update   = _ks.GetById(updateId);
         _vks.IncrementKeepCount(update, vaultId, userId);
         return(Ok(_vks.Create(newVaultKeep)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }