fixing update permission
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user