Skip to content

Switch image_list to images in project show #484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/api/projects/remixes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def remix_params
:project_type,
:locale,
:user_id,
image_list: [],
images: [],
components: %i[id name extension content index])
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def base_params
components: %i[id name extension content index default]
},
parent: {},
image_list: []
images: []
)
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/api/projects/images.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

json.call(@project)

json.image_list @project.images do |image|
json.images @project.images do |image|
json.filename image.filename
json.url rails_blob_url(image)
end
2 changes: 1 addition & 1 deletion app/views/api/projects/show.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ json.components(
:content
)

json.image_list(@project.images) do |image|
json.images(@project.images) do |image|
json.filename(image.filename)
json.url(rails_blob_url(image))
end
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/projects/images_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
let(:params) { { images: [fixture_file_upload(image_filename, 'image/png')] } }
let(:expected_json) do
{
image_list: [
images: [
{
filename: image_filename,
url: rails_blob_url(project.images[0])
Expand Down
10 changes: 5 additions & 5 deletions spec/requests/projects/show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
user_id: project.user_id,
instructions: project.instructions,
components: [],
image_list: [],
images: [],
videos: [],
audio: []
}.to_json
Expand Down Expand Up @@ -72,7 +72,7 @@
identifier: teacher_project.identifier
},
components: [],
image_list: [],
images: [],
videos: [],
audio: [],
user_name: 'Joe Bloggs',
Expand Down Expand Up @@ -101,7 +101,7 @@
locale: another_project.locale,
user_id: another_project.user_id,
components: [],
image_list: [],
images: [],
videos: [],
audio: []
}.to_json
Expand Down Expand Up @@ -132,7 +132,7 @@
user_id: starter_project.user_id,
instructions: nil,
components: [],
image_list: [],
images: [],
videos: [],
audio: []
}.to_json
Expand Down Expand Up @@ -176,7 +176,7 @@
name: project.name,
user_id: project.user_id,
components: [],
image_list: [],
images: [],
videos: [],
audio: []
}.to_json
Expand Down