Skip to content
Snippets Groups Projects
Commit 49f0d22e authored by arieljovananda88's avatar arieljovananda88
Browse files

fix_boolean_type_error

parent f3e6df78
1 merge request!30fix_boolean_type_error
Pipeline #63596 failed with stages
in 3 minutes and 54 seconds
...@@ -27,7 +27,6 @@ func NewAdminBimginganLogHandler(cfg config.BimbinganLogTransportConfig) *AdminB ...@@ -27,7 +27,6 @@ func NewAdminBimginganLogHandler(cfg config.BimbinganLogTransportConfig) *AdminB
func (t *AdminBimbinganLogHandler) MountAdmin(group *echo.Group) { func (t *AdminBimbinganLogHandler) MountAdmin(group *echo.Group) {
group.GET("/bimbingan-logs", t.GetBimbinganLog) group.GET("/bimbingan-logs", t.GetBimbinganLog)
group.GET("/bimbingan-logs-status",t.GetBimbinganLogStatus)
} }
func (t *AdminBimbinganLogHandler) GetBimbinganLog(c echo.Context) error { func (t *AdminBimbinganLogHandler) GetBimbinganLog(c echo.Context) error {
...@@ -47,17 +46,3 @@ func (t *AdminBimbinganLogHandler) GetBimbinganLog(c echo.Context) error { ...@@ -47,17 +46,3 @@ func (t *AdminBimbinganLogHandler) GetBimbinganLog(c echo.Context) error {
return c.JSON(http.StatusOK, utils.ResponseDetailOutput(true, http.StatusOK, "Bimbingan logs successfully retreived", BimbinganLogsBerkas)) return c.JSON(http.StatusOK, utils.ResponseDetailOutput(true, http.StatusOK, "Bimbingan logs successfully retreived", BimbinganLogsBerkas))
} }
func (t *AdminBimbinganLogHandler) GetBimbinganLogStatus(c echo.Context) error {
param, err := utils.GetLimitOffset(c.QueryParams())
nim := c.QueryParam("id_mahasiswa")
if err != nil {
return c.JSON(http.StatusInternalServerError, utils.ResponseDetailOutput(false, http.StatusInternalServerError, err.Error(), nil))
}
listBimbinganLogStatuts, err := t.bimbinganLogUsecase.GetBimbinganLogStatusByStudentId(param, nim)
if err != nil {
return c.JSON(http.StatusBadRequest, utils.ResponseDetailOutput(false, http.StatusBadRequest, err.Error(), nil))
}
return c.JSON(http.StatusOK, utils.ResponseDetailOutput(true, http.StatusOK, "Bimbingan logs Status successfully retreived", listBimbinganLogStatuts))
}
...@@ -27,6 +27,7 @@ func NewMahasiswaBimginganLogHandler(cfg config.BimbinganLogTransportConfig) *Ma ...@@ -27,6 +27,7 @@ func NewMahasiswaBimginganLogHandler(cfg config.BimbinganLogTransportConfig) *Ma
func (t *MahasiswaBimbinganLogHandler) MountMahasiswa(group *echo.Group) { func (t *MahasiswaBimbinganLogHandler) MountMahasiswa(group *echo.Group) {
group.POST("/add-bimbingan-log", t.AddBimbinganLog) group.POST("/add-bimbingan-log", t.AddBimbinganLog)
group.GET("/bimbingan-logs-status", t.GetBimbinganLogStatus)
} }
// AddBimbinganLog godoc // AddBimbinganLog godoc
...@@ -52,3 +53,17 @@ func (t *MahasiswaBimbinganLogHandler) AddBimbinganLog(c echo.Context) error { ...@@ -52,3 +53,17 @@ func (t *MahasiswaBimbinganLogHandler) AddBimbinganLog(c echo.Context) error {
return c.JSON(http.StatusOK, utils.ResponseDetailOutput(true, http.StatusCreated, "Bimbingan log added successfully", newBimbinganLogBerkas)) return c.JSON(http.StatusOK, utils.ResponseDetailOutput(true, http.StatusCreated, "Bimbingan log added successfully", newBimbinganLogBerkas))
} }
func (t *MahasiswaBimbinganLogHandler) GetBimbinganLogStatus(c echo.Context) error {
param, err := utils.GetLimitOffset(c.QueryParams())
nim := c.QueryParam("id_mahasiswa")
if err != nil {
return c.JSON(http.StatusInternalServerError, utils.ResponseDetailOutput(false, http.StatusInternalServerError, err.Error(), nil))
}
listBimbinganLogStatuts, err := t.bimbinganLogUsecase.GetBimbinganLogStatusByStudentId(param, nim)
if err != nil {
return c.JSON(http.StatusBadRequest, utils.ResponseDetailOutput(false, http.StatusBadRequest, err.Error(), nil))
}
return c.JSON(http.StatusOK, utils.ResponseDetailOutput(true, http.StatusOK, "Bimbingan logs Status successfully retreived", listBimbinganLogStatuts))
}
...@@ -481,7 +481,7 @@ func (repo *PendaftaranSidSemRepo) GetNameUntilTopikPlaceholders(idMahasiswa str ...@@ -481,7 +481,7 @@ func (repo *PendaftaranSidSemRepo) GetNameUntilTopikPlaceholders(idMahasiswa str
func (repo *PendaftaranSidSemRepo) GetDosbingNamePlaceholder(idMahasiswa string) (entity.DosbingName, error) { func (repo *PendaftaranSidSemRepo) GetDosbingNamePlaceholder(idMahasiswa string) (entity.DosbingName, error) {
var dosbingName entity.DosbingName var dosbingName entity.DosbingName
query := ` SELECT p.nama FROM pengguna p JOIN dosen_bimbingan db ON p.id = db.dosen_id JOIN pendaftaran_ta pt ON db.pendaftaran_id = pt.id WHERE pt.id_mahasiswa = ? AND pt.status = true;` query := ` SELECT p.nama FROM pengguna p JOIN dosen_bimbingan db ON p.id = db.dosen_id JOIN pendaftaran_ta pt ON db.pendaftaran_id = pt.id WHERE pt.id_mahasiswa = ? AND pt.status = 'APPROVED';`
if err := repo.DBRead.Raw(query, idMahasiswa).Scan(&dosbingName).Error; err != nil { if err := repo.DBRead.Raw(query, idMahasiswa).Scan(&dosbingName).Error; err != nil {
return entity.DosbingName{}, err return entity.DosbingName{}, err
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment