vocdoni / interoperability

Private repository to manage the interoperability between protocol, API, SDK, UIs and documentation
1 stars 0 forks source link

Implement /hasVoted API endpoint (?) #106

Open selankon opened 7 months ago

selankon commented 7 months ago

Actually the client.hasAlreadyVoted uses the endpoint /votes/{vote_id} to check if a voter has already vote. This throws a 404 on the case that the vote is no emitted, causing a javascipt error on the console, which is not ideal.

A solution could be to implement a /hasVoted endpoint which will have the same logic of /votes/{vote_id} but returning true or false (or 204 and the vote).

Absolutely a non necessary enhancement that can be interesting to have, that can save debugging time to the sdk users.

Related https://discord.com/channels/756181194357604548/985621870047002735/1174318990353498122

jpaulet commented 5 months ago

/votes/{vote_id}/hasVoted: Return a 200 with a true/false body on it.