vocdoni / explorer

Vocdoni's Blockchain Explorer
https://dev.explorer.vote
GNU Affero General Public License v3.0
1 stars 0 forks source link

Review process pagination types #122

Closed elboletaire closed 2 months ago

elboletaire commented 2 months ago

Doing some changes, I've found out some weird types in the elections list. On one side, the filters should allow setting the limit, since it's just an object spread to the method, which already allows setting the limit: imatge

On the other hand, the elections list is actually returning more election information than we've typed, not just its id, but the typing here only returns the election id: imatge

[!NOTE] Do not use the curl calls as a reference for the types. Instead, check the actual types returned by the SDK, or simply log the data received. The SDK does some magic and most information is actually provided (in this case, probably the entire election data is returned already)

selankon commented 2 months ago

For the first thing, it was my fault, I omitted the limit I don't remember for which reason. https://github.com/vocdoni/explorer/pull/123/commits/51ad232e4f7fa3b4e26fab58241f5d1bea5d7ccf

But for the second thing... I don't understand you. You are seeing only the id because the election is of type PublishedElection | ArchivedElection | InvalidElection to access to all the properties you have to cast the election to PublishedElection