Skip to content

Commit

Permalink
close #2074 remove api cache (#2075)
Browse files Browse the repository at this point in the history
  • Loading branch information
panhachom authored Nov 22, 2024
1 parent d2a7abb commit dec68e8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ def ensure_waiting_room_session_token
end

def required_waiting_room_session?
apis = [
'/api/v2/storefront/products',
'/api/v2/storefront/taxons'
]
# temporary disable
apis = []

apis.any? { |prefix| request.path.start_with?(prefix) }
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@ def self.prepended(base)
base.attribute :purchasable_on_web do |product|
product.purchasable_on == 'web' || product.purchasable_on == 'both'
end

base.attribute :purchasable do |product|
value = product.purchasable?
[true, false].include?(value) ? value : nil
end

base.attribute :in_stock do |product|
value = product.in_stock?
[true, false].include?(value) ? value : nil
end

base.attribute :backorderable do |product|
value = product.backorderable?
[true, false].include?(value) ? value : nil
end

base.attribute :available do |product|
value = product.available?
[true, false].include?(value) ? value : nil
end
end
end
end
Expand Down

0 comments on commit dec68e8

Please sign in to comment.