Skip to content

Commit

Permalink
Merge pull request #960 from safewlabs/filters
Browse files Browse the repository at this point in the history
Fix Product uploading to Stripe
  • Loading branch information
saurabhbhatia authored Oct 5, 2023
2 parents 8dbaf24 + d584a59 commit d1eb827
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/components/product/filters_component.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div>Add Product::Filters template here</div>
4 changes: 4 additions & 0 deletions app/components/product/filters_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# frozen_string_literal: true

class Product::FiltersComponent < ViewComponent::Base
end
1 change: 1 addition & 0 deletions app/controllers/dashboard/products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def create
@product = Product.new(product_params)
respond_to do |format|
if @product.save
AddProductToStripeJob.perform_async(@product.id)
format.html { redirect_to [:dashboard, @product], notice: "Product was successfully created." }
format.json { render :show, status: :created, location: @product }
else
Expand Down
15 changes: 15 additions & 0 deletions spec/components/product/filters_component_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

require "rails_helper"

RSpec.describe Product::FiltersComponent, type: :component do
pending "add some examples to (or delete) #{__FILE__}"

# it "renders something useful" do
# expect(
# render_inline(described_class.new(attr: "value")) { "Hello, components!" }.css("p").to_html
# ).to include(
# "Hello, components!"
# )
# end
end

0 comments on commit d1eb827

Please sign in to comment.