Skip to content

Commit

Permalink
Remove type attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
radical-ube committed Feb 4, 2025
1 parent 212f7e1 commit 5c2d4f7
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 19 deletions.
2 changes: 1 addition & 1 deletion app/controllers/podcast_engagement_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def podcast_engagement_params
:lock_version,
:donation_url,
:payment_pointer,
subscribe_links_attributes: %i[id enabled external_id platform type]
subscribe_links_attributes: %i[id enabled external_id platform]
)
end
end
4 changes: 2 additions & 2 deletions app/javascript/controllers/subscribe_links_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ export default class extends Controller {

addLink(event) {
const now = new Date().getTime()
const platform = event.target.value
const platform = event.target.dataset.platform

const template = this.templateTargets.filter((target) => {
return target.dataset.platform === platform
})
const html = template[0].innerHTML.replaceAll("NEW_RECORD", now).replaceAll("NEW_PLATFORM", platform)
const html = template[0].innerHTML.replaceAll("NEW_RECORD", now)
this.templateTarget.insertAdjacentHTML("beforeBegin", html)
}
}
6 changes: 0 additions & 6 deletions app/models/subscribe_links/apple.rb

This file was deleted.

Empty file.
Empty file.
6 changes: 0 additions & 6 deletions app/models/subscribe_links/spotify.rb

This file was deleted.

Empty file.
2 changes: 1 addition & 1 deletion app/views/podcast_engagement/_form_subscribe_link.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
</div>
</div>
</div>
<%= form.hidden_field :type %>

<%= form.hidden_field :platform %>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<ul class="dropdown-menu">
<% SubscribeLink::PLATFORMS.each do |p| %>
<li>
<button class="dropdown-item" type="button" data-action="subscribe-links#addLink" value="<%= p %>">
<button class="dropdown-item" type="button" data-action="subscribe-links#addLink" data-platform="<%= p %>">
<%= t(".labels.#{p}") %>
</button>
</li>
Expand Down
1 change: 0 additions & 1 deletion db/migrate/20241220170043_create_subscribe_links.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ def change
t.boolean :enabled
t.integer :external_id
t.string :platform
t.string :type
end
end
end
1 change: 0 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5c2d4f7

Please sign in to comment.