feat (prescription): add approve + create medication

This commit is contained in:
dpurbosakti
2025-09-22 13:21:29 +07:00
parent 02c86a9ec0
commit 202bb32e9c
6 changed files with 196 additions and 59 deletions
@@ -69,3 +69,15 @@ func (obj myBase) Delete(w http.ResponseWriter, r *http.Request) {
res, err := u.Delete(dto)
rw.DataResponse(w, res, err)
}
func (obj myBase) Approve(w http.ResponseWriter, r *http.Request) {
id := rw.ValidateInt(w, "id", r.PathValue("id"))
if id <= 0 {
return
}
dto := e.ReadDetailDto{}
dto.Id = uint(id)
res, err := u.Approve(dto)
rw.DataResponse(w, res, err)
}