-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branches 'feat/api-refactor-pagination' and 'feat/index-blocks'…
… into dev
- Loading branch information
Showing
40 changed files
with
1,221 additions
and
733 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
package api | ||
|
||
////// Disabled autoswag due to https://github.com/swaggo/swag/issues/1267 | ||
////// TODO: re-enable when a fixed swaggo/swag is released | ||
////// and remove the workaround done by @selankon on docs/models/models.go | ||
////go:generate go run go.vocdoni.io/dvote/api/autoswag | ||
//go:generate go run github.com/swaggo/swag/cmd/[email protected] fmt | ||
//go:generate go run go.vocdoni.io/dvote/api/autoswag | ||
//go:generate go run github.com/swaggo/swag/cmd/[email protected] fmt | ||
|
||
import ( | ||
"fmt" | ||
|
@@ -50,8 +47,17 @@ import ( | |
|
||
// @securityDefinitions.basic BasicAuth | ||
|
||
// MaxPageSize defines the maximum number of results returned by the paginated endpoints | ||
const MaxPageSize = 10 | ||
const ( | ||
// ItemsPerPage defines how many items per page are returned by the paginated endpoints | ||
ItemsPerPage = 10 | ||
|
||
// These consts define the keywords for both query (?param=) and url (/url/param/) params | ||
ParamPage = "page" | ||
ParamStatus = "status" | ||
ParamOrganizationID = "organizationID" | ||
ParamElectionID = "electionID" | ||
ParamWithResults = "withResults" | ||
) | ||
|
||
var ( | ||
ErrMissingModulesForHandler = fmt.Errorf("missing modules attached for enabling handler") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.