internal string DeleteVaultKeep(int id, Profile userInfo) { VaultKeep toDelete = _repo.GetKeepById(id); if (toDelete == null) { throw new Exception("No Vault Keep with that ID"); } else if (toDelete.CreatorId != userInfo.Id) { throw new Exception("You do not own this Vault keep, cannot delete"); } else if (_repo.DeleteVaultKeep(id)) { return("Deleted"); } else { return("Error"); } }
public void Delete(int id) { db.DeleteVaultKeep(id); }
public VaultKeep DeleteVaultKeep(VaultKeep oldVaultKeep) { return(_repo.DeleteVaultKeep(oldVaultKeep)); }
[HttpPut] //NOTE "Can Delete Vault Keep" public ActionResult <VaultKeep> Delete([FromBody] VaultKeep vaultKeep) { vaultKeep.UserId = HttpContext.User.FindFirstValue("Id"); return(Ok(_repo.DeleteVaultKeep(vaultKeep))); }
public bool DeleteVaultKeep(int id) { return(_db.DeleteVaultKeep(id)); }