Skip to content

Commit

Permalink
Fix: last action in same API
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Oct 13, 2023
1 parent f12193b commit 0bbe309
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/api/handlers/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func GetSameContracts() gin.HandlerFunc {
if handleError(c, ctx.Storage, err, 0) {
return
}
result.LastAction = same[i].Account.LastAction
result.Network = same[i].Network
response.Contracts = append(response.Contracts, ContractWithStats{
Contract: result,
Expand Down
2 changes: 1 addition & 1 deletion internal/postgres/domains/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (storage *Storage) Same(ctx context.Context, network string, c contract.Con
TableExpr("?.contracts", schema).
ColumnExpr("? as network", value).
ColumnExpr("contracts.*").
ColumnExpr("accounts.address as account__address").
ColumnExpr("accounts.address as account__address, accounts.last_action as account__last_action").
Join("LEFT JOIN ?.accounts on contracts.account_id = accounts.id", schema).
Join("LEFT JOIN ?.scripts as alpha on alpha.id = contracts.alpha_id", schema).
Join("LEFT JOIN ?.scripts as babylon on babylon.id = contracts.babylon_id", schema).
Expand Down

0 comments on commit 0bbe309

Please sign in to comment.