Skip to content

Commit

Permalink
api: remove non paginated endpoints
Browse files Browse the repository at this point in the history
* /chain/transactions [get]
* /accounts/{organizationID}/elections/status/{status} [get]
  • Loading branch information
altergui committed Mar 10, 2023
1 parent f6bb289 commit 477412d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
9 changes: 0 additions & 9 deletions api/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ func (a *API) enableAccountHandlers() error {
); err != nil {
return err
}
if err := a.endpoint.RegisterMethod(
"/accounts/{organizationID}/elections/status/{status}",
"GET",
apirest.MethodAccessTypePublic,
a.electionListHandler,
); err != nil {
return err
}
if err := a.endpoint.RegisterMethod(
"/accounts/{organizationID}/elections/page/{page}",
"GET",
Expand Down Expand Up @@ -261,7 +253,6 @@ func (a *API) treasurerHandler(msg *apirest.APIdata, ctx *httprouter.HTTPContext
// @Description List the elections of an organization
// @Success 200 {object} Organization
// @Router /accounts/{organizationID}/elections/status/{status}/page/{page} [get]
// @Router /accounts/{organizationID}/elections/status/{status} [get]
// @Router /accounts/{organizationID}/elections/page/{page} [get]
func (a *API) electionListHandler(msg *apirest.APIdata, ctx *httprouter.HTTPContext) error {
organizationID, err := hex.DecodeString(util.TrimHex(ctx.URLParam("organizationID")))
Expand Down
9 changes: 0 additions & 9 deletions api/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,6 @@ func (a *API) enableChainHandlers() error {
); err != nil {
return err
}
if err := a.endpoint.RegisterMethod(
"/chain/transactions",
"GET",
apirest.MethodAccessTypePublic,
a.chainTxListPaginated,
); err != nil {
return err
}
if err := a.endpoint.RegisterMethod(
"/chain/transactions/page/{page}",
"GET",
Expand Down Expand Up @@ -351,7 +343,6 @@ func (a *API) chainTxCostHandler(msg *apirest.APIdata, ctx *httprouter.HTTPConte
// @Summary TODO
// @Description TODO
// @Success 200 {object} object
// @Router /chain/transactions [get]
// @Router /chain/transactions/page/{page} [get]
func (a *API) chainTxListPaginated(msg *apirest.APIdata, ctx *httprouter.HTTPContext) error {
page := 0
Expand Down
2 changes: 1 addition & 1 deletion test/apierror_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestAPIerror(t *testing.T) {
want: api.ErrFileSizeTooBig,
},
{
args: args{"GET", nil, []string{"accounts", "totallyWrong!@#$", "elections", "status", "ready"}},
args: args{"GET", nil, []string{"accounts", "totallyWrong!@#$", "elections", "status", "ready", "page", "0"}},
want: api.ErrCantParseOrgID,
},
{
Expand Down

0 comments on commit 477412d

Please sign in to comment.