Skip to content

Commit

Permalink
fix: missing account when get key
Browse files Browse the repository at this point in the history
  • Loading branch information
Candinya committed Jun 5, 2024
1 parent 4e00a8f commit 919bf0c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/service/hub/model/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ func KeyCreate(ctx context.Context, accountAddress common.Address, keyName strin
}

func KeyGetByID(ctx context.Context, keyID uint64, activeOnly bool, databaseClient *gorm.DB, controlClient *control.StateClientWriter) (*Key, bool, error) {
queryBase := databaseClient.WithContext(ctx).Model(&table.GatewayKey{})
queryBase := databaseClient.
WithContext(ctx).
Model(&table.GatewayKey{}).
Preload("Account")

if activeOnly {
queryBase = queryBase.Unscoped()
Expand Down

0 comments on commit 919bf0c

Please sign in to comment.