fixing update permission

This commit is contained in:
renaldybrada
2026-02-26 09:20:11 +07:00
parent be64a85350
commit fd3bd0ae5d
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -557,7 +557,7 @@ func (r accessRepo) updateActivePermissionById(c context.Context, tx *sql.Tx, pe
log.Printf("failed create update permission query : %v", err)
return err
}
_, err = tx.ExecContext(c, sql, args)
_, err = tx.ExecContext(c, sql, args...)
if err != nil {
log.Printf("failed executing update permission : %v", err)
return err
+2 -2
View File
@@ -67,11 +67,11 @@ type AccessPage struct {
Page string `json:"page"`
IsActive bool `json:"is_active" binding:"required"`
Sort int `json:"sort"`
ParentId *string `json:"parent_id"`
ParentId *string `json:"parent_id" binding:"uuid"`
}
type DetailRolePageResponse struct {
ID string `json:"id" db:"id" binding:"required"`
ID string `json:"id" db:"id" binding:"required,uuid"`
Name string `json:"name" db:"name"`
Status bool `json:"status" db:"is_active"`
AccessPage []AccessPage `json:"access_page"`
+2
View File
@@ -35,6 +35,8 @@ func errorMessage(fe validator.FieldError) string {
errorInfo = "harus diisi maksimal " + fe.Param()
case "oneof":
errorInfo = "hanya bisa diisi dengan : " + fe.Param()
case "uuid":
errorInfo = "harus diisi dengan uuid"
default:
errorInfo = "tidak valid"
}