From 26730c166d493faa70dbfcaa6d4fc633beea0e47 Mon Sep 17 00:00:00 2001 From: Matthew Rider Date: Wed, 11 Sep 2024 19:04:36 +0200 Subject: [PATCH] Fix: Scope contributors count url to org (#2022) Fixes #2021 --- app/components/request_form/request_form.html.erb | 1 + app/components/request_form/request_form.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/components/request_form/request_form.html.erb b/app/components/request_form/request_form.html.erb index a9d91e242..9c318e673 100644 --- a/app/components/request_form/request_form.html.erb +++ b/app/components/request_form/request_form.html.erb @@ -4,6 +4,7 @@ data-request-form-members-count-message-value="<%= t('components.request_form.members_count_message').to_json %>" data-request-form-preview-fallback-value="<%= t('components.request_form.preview_fallback') %>" data-request-form-request-files-url-value="<%= @request.files.map { |file| url_for(file) } %>" + data-request-form-update-members-count-url-value="<%= count_organization_contributors_path(@request.organization) %>" >
diff --git a/app/components/request_form/request_form.js b/app/components/request_form/request_form.js index 1ff63481a..759a7a566 100644 --- a/app/components/request_form/request_form.js +++ b/app/components/request_form/request_form.js @@ -20,6 +20,7 @@ export default class extends Controller { membersCountMessage: String, previewFallback: String, requestFilesUrl: Array, + updateMembersCountUrl: String, }; connect() { @@ -75,7 +76,7 @@ export default class extends Controller { const tags = event.detail.tags; Rails.ajax({ - url: '/contributors/count', + url: this.updateMembersCountUrlValue, type: 'GET', data: new URLSearchParams({ tag_list: tags }).toString(), success: ({ count }) => {