Skip to content

Commit

Permalink
Add (re)request @results endpoint with support of extra params
Browse files Browse the repository at this point in the history
  • Loading branch information
boulch committed Feb 26, 2025
1 parent 7a567db commit af3e51e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/imio/smartweb/core/contents/rest/campaign/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ def query_url(self):
project_id = self.request.form.get("id")
url = f"{wcs_api}/cards/imio-ideabox-projet/{project_id}?full=on"
else:
# we want list of projects for a specific campaign
# we want list of projects for a specific campaign with eventually extra pamams (zone, topic, ...)
extra_params = [f"{k}={v}" for k, v in self.request.form.items()]
extra_params = "&".join(extra_params)
campaign_id = self.context.linked_campaign
url = f"{wcs_api}/cards/imio-ideabox-projet/list?campagne={campaign_id}&full=on&filter-statut=Vote|Enregistr%C3%A9e&filter-statut-operator=in"
url = f"{wcs_api}/cards/imio-ideabox-projet/list?campagne={campaign_id}&full=on&filter-statut=Vote|Enregistr%C3%A9e&filter-statut-operator=in&{extra_params}"
return url


Expand Down

0 comments on commit af3e51e

Please sign in to comment.