working commit
This commit is contained in:
@@ -60,6 +60,7 @@ func (oper *Operator) CreateAccount(ctx context.Context, operatorID string, para
|
||||
return res, err
|
||||
}
|
||||
|
||||
// GetAccount
|
||||
type GetAccountParams struct {
|
||||
Username string `json:"username"`
|
||||
AccountID string `json:"accountId"`
|
||||
@@ -114,14 +115,14 @@ func (oper *Operator) GetAccount(ctx context.Context, params *GetAccountParams)
|
||||
CreatedBy: accountDescr.CreatedBy,
|
||||
UpdatedBy: accountDescr.UpdatedBy,
|
||||
Disabled: accountDescr.Disabled,
|
||||
Grants: make([]descr.GrantShort, 0),
|
||||
Grants: make([]descr.Grant, 0),
|
||||
}
|
||||
grantDescrs, err := oper.mdb.ListGrantsByAccountID(ctx, accountDescr.ID)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
for _, grantDescrs := range grantDescrs {
|
||||
grantShorts := descr.GrantShort{
|
||||
grantShorts := descr.Grant{
|
||||
Right: grantDescrs.Right,
|
||||
Pattern: grantDescrs.Pattern,
|
||||
CreatedAt: grantDescrs.CreatedAt,
|
||||
@@ -282,14 +283,14 @@ func (oper *Operator) ListAccounts(ctx context.Context, params *ListAccountsPara
|
||||
UpdatedAt: accountDescr.UpdatedAt,
|
||||
CreatedBy: accountDescr.CreatedBy,
|
||||
UpdatedBy: accountDescr.UpdatedBy,
|
||||
Grants: make([]descr.GrantShort, 0),
|
||||
Grants: make([]descr.Grant, 0),
|
||||
}
|
||||
grantDescrs, err := oper.mdb.ListGrantsByAccountID(ctx, accountDescr.ID)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
for _, grantDescrs := range grantDescrs {
|
||||
grantShorts := descr.GrantShort{
|
||||
grantShorts := descr.Grant{
|
||||
Right: grantDescrs.Right,
|
||||
Pattern: grantDescrs.Pattern,
|
||||
CreatedAt: grantDescrs.CreatedAt,
|
||||
|
||||
Reference in New Issue
Block a user