edit query
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
type TabDaftarPesertaServices interface {
|
||||
GetListMcuDaftarPeserta(id string, currentpage int, rowperpage int) ([]models.ModelMcuDaftarPeserta, int, error)
|
||||
GetReportMcu(orderheaderID string) ([]models.TabViewReportMcu, error)
|
||||
GetListReportPeserta(orderheaderID string, host string) ([]models.TabViewReportMcu, error)
|
||||
}
|
||||
|
||||
type TabDaftarPesertaHandlers struct {
|
||||
@@ -170,13 +171,25 @@ func (tdp *TabDaftarPesertaHandlers) HandlePagination(c echo.Context) error {
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleOpenReportDialog(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
host := c.Request().Host
|
||||
|
||||
idx := c.QueryParam("idx")
|
||||
dialogReportID := c.QueryParam("dialogReportID")
|
||||
dialogReportBodyID := c.QueryParam("dialogReportBodyID")
|
||||
logger.Info("params", zap.Any("idx", idx))
|
||||
|
||||
tabData, err := tdp.TabDaftarPesertaServices.GetReportMcu(idx)
|
||||
// tabData, err := tdp.TabDaftarPesertaServices.GetReportMcu(idx)
|
||||
// if err != nil {
|
||||
// tab := corporate_mcudetail.TabReportView([]models.TabViewReportMcu{})
|
||||
// mod := corporate_mcudetail.ModalBody(
|
||||
// dialogReportBodyID,
|
||||
// tab,
|
||||
// corporate_mcudetail.JsShowModal(""),
|
||||
// )
|
||||
// return utils.View(c, mod)
|
||||
// }
|
||||
|
||||
newtabdata, err := tdp.TabDaftarPesertaServices.GetListReportPeserta(idx, host)
|
||||
if err != nil {
|
||||
tab := corporate_mcudetail.TabReportView([]models.TabViewReportMcu{})
|
||||
mod := corporate_mcudetail.ModalBody(
|
||||
@@ -187,7 +200,9 @@ func (tdp *TabDaftarPesertaHandlers) HandleOpenReportDialog(c echo.Context) erro
|
||||
return utils.View(c, mod)
|
||||
}
|
||||
|
||||
tabcomponent := corporate_mcudetail.TabReportView(tabData)
|
||||
logger.Info("resp new data", zap.Any("data", newtabdata))
|
||||
|
||||
tabcomponent := corporate_mcudetail.TabReportView(newtabdata)
|
||||
|
||||
modalbody := corporate_mcudetail.ModalBody(
|
||||
dialogReportBodyID,
|
||||
|
||||
@@ -21,6 +21,7 @@ type PatientService interface {
|
||||
GetListtingData(email string, currentpage int, rowperpage int) ([]models.DashboardPatient, int, error)
|
||||
GetPatientData(email string) (string, error)
|
||||
GetReportMcu(orderheaderID string) ([]models.TabViewReportMcu, error)
|
||||
GetListReportPeserta(orderheaderID string, host string) ([]models.TabViewReportMcu, error)
|
||||
}
|
||||
|
||||
func NewPatientHandler(us PatientService) *PatientHandler {
|
||||
@@ -214,13 +215,25 @@ func (ph *PatientHandler) HandleChangePage(c echo.Context) error {
|
||||
|
||||
func (ph *PatientHandler) HandleOpenReport(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
host := c.Request().Host
|
||||
|
||||
id := c.QueryParam("id")
|
||||
dialogID := c.QueryParam("dialogID")
|
||||
dialogBodyID := c.QueryParam("dialogBodyID")
|
||||
logger.Info("params", zap.Any("id", id))
|
||||
|
||||
tabData, err := ph.PatientService.GetReportMcu(id)
|
||||
// tabData, err := ph.PatientService.GetReportMcu(id)
|
||||
// if err != nil {
|
||||
// tab := corporate_patient.TabReportView([]models.TabViewReportMcu{})
|
||||
// mod := corporate_patient.ModalBody(
|
||||
// dialogBodyID,
|
||||
// tab,
|
||||
// corporate_patient.JsShowModal(""),
|
||||
// )
|
||||
// return utils.View(c, mod)
|
||||
// }
|
||||
|
||||
newtabdata, err := ph.PatientService.GetListReportPeserta(id, host)
|
||||
if err != nil {
|
||||
tab := corporate_patient.TabReportView([]models.TabViewReportMcu{})
|
||||
mod := corporate_patient.ModalBody(
|
||||
@@ -231,7 +244,7 @@ func (ph *PatientHandler) HandleOpenReport(c echo.Context) error {
|
||||
return utils.View(c, mod)
|
||||
}
|
||||
|
||||
tabcomponent := corporate_patient.TabReportView(tabData)
|
||||
tabcomponent := corporate_patient.TabReportView(newtabdata)
|
||||
modalBody := corporate_patient.ModalBody(
|
||||
dialogBodyID,
|
||||
tabcomponent,
|
||||
|
||||
Reference in New Issue
Block a user