fix typo const
This commit is contained in:
@@ -85,7 +85,7 @@ func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func (obj myBase) CheckOut(w http.ResponseWriter, r *http.Request) {
|
||||
const dataValidationVail = "data-validation-fail"
|
||||
const dataValidationFail = "data-validation-fail"
|
||||
|
||||
dto := e.DischargeDto{}
|
||||
id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
@@ -103,7 +103,7 @@ func (obj myBase) CheckOut(w http.ResponseWriter, r *http.Request) {
|
||||
case ere.DMCDeath:
|
||||
if dto.DeathCause == nil {
|
||||
rw.DataResponse(w, nil, d.FieldError{
|
||||
Code: dataValidationVail,
|
||||
Code: dataValidationFail,
|
||||
Message: "deathCause required if discharge_method_code is death",
|
||||
})
|
||||
return
|
||||
@@ -111,7 +111,7 @@ func (obj myBase) CheckOut(w http.ResponseWriter, r *http.Request) {
|
||||
case ere.DMCConsulPoly, ere.DMCConsulExecutive:
|
||||
if dto.InternalReferences == nil {
|
||||
rw.DataResponse(w, nil, d.FieldError{
|
||||
Code: dataValidationVail,
|
||||
Code: dataValidationFail,
|
||||
Message: fmt.Sprintf("internalReferences required if discharge_method_code is %s", *dto.Discharge_Method_Code),
|
||||
})
|
||||
return
|
||||
@@ -120,7 +120,7 @@ func (obj myBase) CheckOut(w http.ResponseWriter, r *http.Request) {
|
||||
for _, v := range *dto.InternalReferences {
|
||||
if v.Unit_Id == nil {
|
||||
rw.DataResponse(w, nil, d.FieldError{
|
||||
Code: dataValidationVail,
|
||||
Code: dataValidationFail,
|
||||
Message: "internalReferences.unit_id required",
|
||||
})
|
||||
return
|
||||
@@ -128,7 +128,7 @@ func (obj myBase) CheckOut(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if v.Doctor_Id == nil {
|
||||
rw.DataResponse(w, nil, d.FieldError{
|
||||
Code: dataValidationVail,
|
||||
Code: dataValidationFail,
|
||||
Message: "internalReferences.doctor_id required",
|
||||
})
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user