public ActionResult <string> Delete(int id) { bool successful = _tr.Delete(id); if (successful) { return(BadRequest("Failed to delete vault")); } return(Ok()); }
public ActionResult <string> Delete(int id) { try { return(Ok(_repo.Delete(id))); } catch (Exception e) { return(BadRequest(e)); } }
public ActionResult <string> Delete(int id) { bool wasSuccessful = _vr.Delete(id); if (wasSuccessful) { return(Ok()); } return(BadRequest()); }
public ActionResult <string> Delete(int id) { try { string uid = HttpContext.User.FindFirstValue("Id"); return(Ok(_repo.Delete(id, uid))); } catch (Exception e) { return(BadRequest(e)); } }
public bool Delete([FromBody] VaultToDelete vault) { if (!ModelState.IsValid) { throw new Exception("Invalid information."); } if (vault.UserId != vault.SendingUserId) { throw new Exception("you can't delete a vault that's not yours."); } return(_repo.Delete(vault.Id)); }
public ActionResult <string> Delete(int id) { // var UserId = HttpContext.User.Identity.Name; // if (UserId == Vault.UserId) bool successful = _vr.Delete(id); if (!successful) { return(BadRequest("Unable to DELETE: Delete was not successful.")); } return(Ok()); }
public int Delete(int id) { return(_repo.Delete(id)); }
public void Delete(int vaultId) { _repo.Delete(vaultId); return; }
public void Delete(int id) { _repo.Delete(id); }
public bool Delete(int id) { return(_repo.Delete(id)); }
public void Delete([FromRoute] int id) { _repo.Delete(id); }