fix: correct query order in GetRoleByID method for proper role retrieval
This commit is contained in:
parent
79080ce64d
commit
d1beb610a7
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue