Skip to content

Commit

Permalink
all votes endpoint: rename and fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ecioppettini committed Mar 28, 2024
1 parent 945a2a8 commit 94733f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import { governanceVotesForAddress } from '../services/GovernanceVotesForAddress
import { resolvePageStart, resolveUntilTransaction } from '../services/PaginationService';
import { GOVERNANCE_VOTES_LIMIT } from '../../../shared/constants';
import { expectType } from 'tsd';
import { GovernanceVotesForAddressResponse } from '../../../shared/models/Governance';
import { GovernanceVotesForCredentialResponse } from '../../../shared/models/Governance';

const route = Routes.governanceVotesForAddress;

@Route('governance/credential/votes')
export class GovernanceVotesForAddress extends Controller {
export class GovernanceVotesForCredential extends Controller {
/**
* Returns the drep of the last delegation for this address.
* Returns votes cast by a credential. Sorted in descending order (newer first).
*/
@SuccessResponse(`${StatusCodes.OK}`)
@Post()
Expand Down Expand Up @@ -68,7 +68,7 @@ export class GovernanceVotesForAddress extends Controller {
dbTx,
});

return data as GovernanceVotesForAddressResponse;
return data as GovernanceVotesForCredentialResponse;
}
);

Expand Down
4 changes: 2 additions & 2 deletions webserver/shared/models/Governance.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { CredentialHex } from "./Address";
import { AfterBlockPagination, UntilBlockPagination } from "./common";

export type GovernanceVotesForAddressRequest = {
export type GovernanceVotesForCredentialRequest = {
credential: CredentialHex;
limit?: number | undefined;
} & UntilBlockPagination &
AfterBlockPagination;

export type GovernanceVotesForAddressResponse = {
export type GovernanceVotesForCredentialResponse = {
votes: { govActionId: string; vote: string }[];
txId: string;
block: string;
Expand Down

0 comments on commit 94733f0

Please sign in to comment.