Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: return empty lists from fetchApplications and fetchAppLocalStates #1010

Merged
merged 1 commit into from
May 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -833,8 +833,8 @@ func notFound(ctx echo.Context, err string) error {

// fetchApplications fetches all results
func (si *ServerImplementation) fetchApplications(ctx context.Context, params idb.ApplicationQuery) ([]generated.Application, uint64, error) {
var apps []generated.Application
var round uint64
apps := make([]generated.Application, 0)
err := callWithTimeout(ctx, si.log, si.timeout, func(ctx context.Context) error {
var results <-chan idb.ApplicationRow
results, round = si.db.Applications(ctx, params)
Expand All @@ -857,8 +857,8 @@ func (si *ServerImplementation) fetchApplications(ctx context.Context, params id

// fetchAppLocalStates fetches all generated.AppLocalState from a query
func (si *ServerImplementation) fetchAppLocalStates(ctx context.Context, params idb.ApplicationQuery) ([]generated.ApplicationLocalState, uint64, error) {
var als []generated.ApplicationLocalState
var round uint64
als := make([]generated.ApplicationLocalState, 0)
err := callWithTimeout(ctx, si.log, si.timeout, func(ctx context.Context) error {
var results <-chan idb.AppLocalStateRow
results, round = si.db.AppLocalState(ctx, params)
Expand Down