fix (patient): missing authinfo on update
This commit is contained in:
@@ -59,11 +59,17 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
authInfo, err := pa.GetAuthInfo(r)
|
||||||
|
if err != nil {
|
||||||
|
rw.WriteJSON(w, http.StatusUnauthorized, d.IS{"message": err.Error()}, nil)
|
||||||
|
}
|
||||||
|
|
||||||
dto := e.UpdateDto{}
|
dto := e.UpdateDto{}
|
||||||
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
dto.Id = uint(id)
|
dto.Id = uint(id)
|
||||||
|
dto.AuthInfo = *authInfo
|
||||||
res, err := u.Update(dto)
|
res, err := u.Update(dto)
|
||||||
rw.DataResponse(w, res, err)
|
rw.DataResponse(w, res, err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user