Skip to content

Commit

Permalink
Fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
jcraigk committed Nov 6, 2024
1 parent 8ba0722 commit ad83428
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/api/api_v2/shows.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ApiV2::Shows < ApiV2::Base
class ApiV2::Shows < ApiV2::Base # rubocop:disable Metrics/ClassLength
SORT_COLS = %w[date likes_count duration updated_at]

helpers do
Expand Down
2 changes: 1 addition & 1 deletion app/api/api_v2/years.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def stats_for(period)
else
shows.during_year(period)
end
cover_art_urls = shows.order(date: :desc).first.cover_art_urls
cover_art_urls = shows.order(date: :desc).first&.cover_art_urls
[ shows.count, shows.select(:venue_id).distinct.count, shows.sum(:duration), cover_art_urls ]
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/Eras.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const Eras = () => {

const renderGridItem = ({ period, shows_count, venues_count, cover_art_urls }) => (
<Link to={`/${period}`} key={period} className="list-item-link">
<li className="grid-item" style={{ backgroundImage: `url(${cover_art_urls.medium})` }}>
<li className="grid-item" style={{ backgroundImage: `url(${cover_art_urls?.medium})` }}>
<div className="overlay">
<p className={`period ${period.includes("-") ? "period-range" : ""}`}>{period}</p>
<p className="period-details">
Expand Down

0 comments on commit ad83428

Please sign in to comment.