Skip to content

Commit

Permalink
Fix: Scope contributors count url to org (#2022)
Browse files Browse the repository at this point in the history
Fixes #2021
  • Loading branch information
mattwr18 authored Sep 11, 2024
1 parent 3c2bca1 commit 26730c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/components/request_form/request_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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) %>"
>

<div class="RequestForm-column" data-action="input->request-form#updatePreview">
Expand Down
3 changes: 2 additions & 1 deletion app/components/request_form/request_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default class extends Controller {
membersCountMessage: String,
previewFallback: String,
requestFilesUrl: Array,
updateMembersCountUrl: String,
};

connect() {
Expand Down Expand Up @@ -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 }) => {
Expand Down

0 comments on commit 26730c1

Please sign in to comment.