decidim-vocdoni / decidim-module-vocdoni

(WIP) A module for Decidim that brings an elections component based on the Vocdoni SDK and API
GNU Affero General Public License v3.0
7 stars 0 forks source link

Review hardcoded URLs #79

Open andreslucena opened 7 months ago

andreslucena commented 7 months ago

Comes from comment

Having the hardcoded URLs in the module was because we didn't have a way of knowing from Ruby-land the values from the NPM package. Now that we have the SDK integrated in Ruby we could extract it with the node-wrapper, right @microstudi?

Currently we have this URL in multiple places, for instance for STG:

❯ rg https://api-stg.vocdoni.net .
./lib/decidim/vocdoni.rb
18:      "stg" => "https://api-stg.vocdoni.net/v2",

./app/packs/src/decidim/vocdoni/voter/setup-vote.js
39:    client.url = "https://api-stg.vocdoni.net/v2";

./spec/lib/decidim/vocdoni/module_config_spec.rb
46:        expect(Decidim::Vocdoni::API_ENDPOINTS["stg"]).to eq("https://api-stg.vocdoni.net/v2")

./spec/fixtures/files/account.json
2:https://api-stg.vocdoni.net/v2/accounts/0xC32dd52AA9F18efa0f28628e7f6b7f77aD6D7dd4

In the past it already changed, and it'll be much better to extract it from the SDK/node-wrapper directly

microstudi commented 5 months ago

not sure this is a good idea, what about using this module against a different instance of vocdoni (I know is a long shot anyway)