Ejemplo n.º 1
0
func DeleteContactType(rw http.ResponseWriter, req *http.Request, params martini.Params, enc encoding.Encoder) string {
	var err error
	var ct contact.ContactType

	if ct.ID, err = strconv.Atoi(params["id"]); err != nil {
		apierror.GenerateError("Trouble getting contact type ID", err, rw, req)
	}

	if err = ct.Delete(); err != nil {
		apierror.GenerateError("Trouble deleting contact type ID", err, rw, req)
	}

	return encoding.Must(enc.Encode(ct))
}