Merge branch 'feat/sync-setting' into feat/sync-from-simgos-161

This commit is contained in:
poetrasapoetra
2025-12-01 13:07:43 +07:00
9 changed files with 141 additions and 129 deletions
@@ -63,7 +63,15 @@ func (obj myBase) Update(w http.ResponseWriter, r *http.Request) {
if res := rw.ValidateStructByIOR(w, r.Body, &dto); !res {
return
}
authInfo, err := pa.GetAuthInfo(r)
if err != nil {
rw.WriteJSON(w, http.StatusUnauthorized, d.IS{"message": err.Error()}, nil)
}
dto.Id = uint(id)
dto.AuthInfo = *authInfo
res, err := u.Update(dto)
rw.DataResponse(w, res, err)
}
@@ -75,7 +83,15 @@ func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
}
dto := e.DeleteDto{}
authInfo, err := pa.GetAuthInfo(r)
if err != nil {
rw.WriteJSON(w, http.StatusUnauthorized, d.IS{"message": err.Error()}, nil)
}
dto.Id = uint(id)
dto.AuthInfo = *authInfo
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}