feat/order-things: adjust procedure-room-order
This commit is contained in:
@@ -273,7 +273,14 @@ func SetRoutes() http.Handler {
|
||||
"PATCH /{id}/complete": materialorder.O.Complete,
|
||||
})
|
||||
hc.RegCrud(r, "/v1/procedure-room", procedureroom.O)
|
||||
hc.RegCrud(r, "/v1/procedure-room-order", procedureroomorder.O)
|
||||
hk.GroupRoutes("/v1/procedure-room-order", r, auth.GuardMW, hk.MapHandlerFunc{
|
||||
"GET /": procedureroomorder.O.GetList,
|
||||
"GET /{id}": procedureroomorder.O.GetDetail,
|
||||
"POST /": procedureroomorder.O.Create,
|
||||
"PATCH /{id}": procedureroomorder.O.Update,
|
||||
"DELETE /{id}": procedureroomorder.O.Delete,
|
||||
"PATCH /{id}/submit": procedureroomorder.O.Submit,
|
||||
})
|
||||
hc.RegCrud(r, "/v1/procedure-room-order-item", procedureroomorderitem.O)
|
||||
hk.GroupRoutes("/v1/consultation", r, auth.GuardMW, hk.MapHandlerFunc{
|
||||
"GET /": consultation.O.GetList,
|
||||
|
||||
@@ -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) Submit(w http.ResponseWriter, r *http.Request) {
|
||||
id := rw.ValidateInt(w, "id", r.PathValue("id"))
|
||||
if id <= 0 {
|
||||
return
|
||||
}
|
||||
|
||||
dto := e.ReadDetailDto{}
|
||||
dto.Id = uint64(id)
|
||||
res, err := u.Submit(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user