Delete species

This commit is contained in:
Matthew Dillon 2015-10-12 10:40:47 -07:00
parent 50bee9ab88
commit 20026ebfd9
4 changed files with 13 additions and 2 deletions

View file

@ -155,3 +155,13 @@ func (s SpeciesService) Create(e *types.Entity, genus string, claims *types.Clai
}
return nil
}
// Delete deletes a single species
func (s SpeciesService) Delete(id int64, genus string, claims *types.Claims) *types.AppError {
q := `DELETE FROM species WHERE id=$1;`
// TODO: fix this
if _, err := models.DBH.Exec(q, id); err != nil {
return newJSONError(err, http.StatusInternalServerError)
}
return nil
}