Skip to content

Commit 1715ce4

Browse files
committed
CP changes: fix sector ref 3
1 parent 4e3f193 commit 1715ce4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

app/controllers/tpi/sectors_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def emissions_chart_data
8686
# Type: bar chart
8787
# On pages: :show (Chemicals only)
8888
def chemicals_alignment_chart_data
89-
data = ::Api::Charts::ChemicalsSector.new(@sector).alignment_data
89+
sector = @sector || TPISector.companies.tpi_tool.friendly.find(params[:id])
90+
data = ::Api::Charts::ChemicalsSector.new(sector).alignment_data
9091

9192
render json: data.to_json
9293
end

0 commit comments

Comments
 (0)