Skip to content

Commit

Permalink
fix listProposalVotes
Browse files Browse the repository at this point in the history
  • Loading branch information
canonbrother committed Jan 3, 2024
1 parent 7c17c0a commit e593410
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions apps/whale-api/src/e2e.defid.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,22 +165,17 @@ export class DGovernanceController extends DefidOceanController {
return await this.api.get(`/governance/proposals/${id}`)

Check warning on line 165 in apps/whale-api/src/e2e.defid.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/whale-api/src/e2e.defid.module.ts#L164-L165

Added lines #L164 - L165 were not covered by tests
}

async listProposalVotes (id: string, query: OceanProposalQuery): Promise<ApiPagedResponse<ProposalVotesResult>> {
const q: OceanProposalQuery = {
masternode: MasternodeType.MINE,
cycle: 0,
all: false,
query: {
size: 30,
next: undefined
},
...query
}
const qStr = `masternode=${q.masternode}&cycle=${q.cycle}&all=${q.all}&size=${q.query?.size}`
if (q?.query?.next !== undefined) {
return await this.api.get(`/governance/proposals/${id}/votes?${qStr}&next=${q.query.next}`)
async listProposalVotes (
id: string,
masternode = MasternodeType.MINE,
cycle = 0,
all = false,
query: OceanListQuery = { size: 30 }
): Promise<ApiPagedResponse<ProposalVotesResult>> {
if (query.next !== undefined) {
return await this.api.get(`/governance/proposals/${id}/votes?masternode=${masternode}&cycle=${cycle}&all=${all}&size=${query.size}&next=${query.next}`)

Check warning on line 176 in apps/whale-api/src/e2e.defid.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/whale-api/src/e2e.defid.module.ts#L176

Added line #L176 was not covered by tests
}
return await this.api.get(`/governance/proposals/${id}/votes?${qStr}`)
return await this.api.get(`/governance/proposals/${id}/votes?masternode=${masternode}&cycle=${cycle}&all=${all}&size=${query.size}`)

Check warning on line 178 in apps/whale-api/src/e2e.defid.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/whale-api/src/e2e.defid.module.ts#L178

Added line #L178 was not covered by tests
}
}

Expand Down

0 comments on commit e593410

Please sign in to comment.