Skip to content

Commit

Permalink
api: hotfix 'organization not found' error
Browse files Browse the repository at this point in the history
due to how the indexer is organized, if an organization hasn't created yet any election,
EntityExists returns false although the account does exist.
  • Loading branch information
altergui committed Sep 9, 2024
1 parent 631f45d commit 99a44ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/elections.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ func (a *API) electionListHandler(_ *apirest.APIdata, ctx *httprouter.HTTPContex
//
// Errors returned are always of type APIerror.
func (a *API) electionList(params *ElectionParams) (*ElectionsList, error) {
if params.OrganizationID != "" && !a.indexer.EntityExists(params.OrganizationID) {
if params.OrganizationID != "" && !a.indexer.AccountExists(params.OrganizationID) {
return nil, ErrOrgNotFound
}

Expand Down

0 comments on commit 99a44ab

Please sign in to comment.