step 6 : ganti query param dengan nomorRegistrasi
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
type KartuKontrolService interface {
|
||||
GetkartuKontrolById(id string) ([]models.KartuKontrolModel, error)
|
||||
GetkartuKontrolById(nomorRegistrasi string) ([]models.KartuKontrolModel, error)
|
||||
}
|
||||
|
||||
func NewKartuKontrolHandler(us KartuKontrolService) *KartuKontrolHandler {
|
||||
@@ -26,23 +26,23 @@ type KartuKontrolHandler struct {
|
||||
|
||||
func (lh *KartuKontrolHandler) HandlerShowKartuKontrol(c echo.Context) error {
|
||||
|
||||
id := c.Param("id")
|
||||
// id := "1"
|
||||
nomorRegistrasi := c.Param("nomorRegistrasi")
|
||||
// nomorRegistrasi := "1"
|
||||
logger, _ := zap.NewProduction()
|
||||
defer logger.Sync()
|
||||
|
||||
dataKartuKontrol, err := lh.KartuKontrolService.GetkartuKontrolById(id)
|
||||
dataKartuKontrol, err := lh.KartuKontrolService.GetkartuKontrolById(nomorRegistrasi)
|
||||
|
||||
if err != nil {
|
||||
logger.Info("Error",
|
||||
zap.Any("Error", err),
|
||||
zap.Any("prm", id),
|
||||
zap.Any("prm", nomorRegistrasi),
|
||||
)
|
||||
return err
|
||||
}
|
||||
logger.Info("SHOW DATA KARTU KONTROL handler",
|
||||
zap.Any("return", dataKartuKontrol),
|
||||
zap.Any("prm", id),
|
||||
zap.Any("prm", nomorRegistrasi),
|
||||
)
|
||||
|
||||
var si templ.Component
|
||||
|
||||
@@ -210,6 +210,6 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
|
||||
// kartu kontrol
|
||||
devKartuKontrolServices := dev_services.NewServicesKartuKontrol(appStore)
|
||||
devKartuKontrolhandlers := dev_handlers.NewKartuKontrolHandler(devKartuKontrolServices)
|
||||
dev.GET("/kartukontrol/:id", devKartuKontrolhandlers.HandlerShowKartuKontrol)
|
||||
dev.GET("/kartukontrol/:nomorRegistrasi", devKartuKontrolhandlers.HandlerShowKartuKontrol)
|
||||
dev.GET("/modalsurveykartukontrol", devKartuKontrolhandlers.HandlerShowWordingModalSurveyMcu)
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ type ServicesKartuKontrol struct {
|
||||
KartuKontrolStore db.AppStore
|
||||
}
|
||||
|
||||
func (su *ServicesKartuKontrol) GetkartuKontrolById(id string) ([]models.KartuKontrolModel, error) {
|
||||
func (su *ServicesKartuKontrol) GetkartuKontrolById(nomorRegistrasi string) ([]models.KartuKontrolModel, error) {
|
||||
|
||||
logger, _ := zap.NewProduction()
|
||||
defer logger.Sync()
|
||||
|
||||
Reference in New Issue
Block a user