fix: correct query order in GetRoleByID method for proper role retrieval

This commit is contained in:
Habib Fatkhul Rohman 2025-11-21 14:58:04 +07:00
parent 79080ce64d
commit d1beb610a7
1 changed files with 1 additions and 1 deletions

View File

@ -206,11 +206,11 @@ func (r *roleRepository) GetRoleByID(ctx context.Context, tx *gorm.DB, id string
}
var role entities.M_Role
if err := tx.WithContext(ctx).
Where("id = ?", id).
Preload("Client").
Preload("Permissions").
Preload("Menus").
Preload("Menus.Parent").
Where("id = ?", id).
First(&role).Error; err != nil {
return entities.M_Role{}, err
}