Skip to content
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

[59468] Removed embedded file links colelction from work package resource #17403

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@ module FileLinkRelationRepresenter
method: :post
}
end

property :file_links,
embedded: true,
exec_context: :decorator,
if: ->(*) { embed_links && current_user.allowed_in_project?(:view_file_links, represented.project) },
uncacheable: true

def file_links
::API::V3::FileLinks::FileLinkCollectionRepresenter.new(represented.file_links,
self_link: api_v3_paths.file_links(represented.id),
current_user:)
end
end
end
end
Expand Down
10 changes: 5 additions & 5 deletions spec/requests/api/v3/work_packages/create_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
end

it "creates a work package" do
expect(WorkPackage.all.count).to eq(1)
expect(WorkPackage.count).to eq(1)
end

it "uses the given parameters" do
Expand Down Expand Up @@ -152,7 +152,7 @@
it_behaves_like "multiple errors", 422

it "does not create a work package" do
expect(WorkPackage.all.count).to eq(0)
expect(WorkPackage.count).to eq(0)
end
end

Expand All @@ -176,7 +176,7 @@
end

it "does not create a work package" do
expect(WorkPackage.all.count).to eq(0)
expect(WorkPackage.count).to eq(0)
end
end

Expand Down Expand Up @@ -227,7 +227,7 @@
end

it "does not create a work package" do
expect(WorkPackage.all.count).to eq(0)
expect(WorkPackage.count).to eq(0)
end
end

Expand Down Expand Up @@ -310,7 +310,7 @@
expect(last_response.body).to be_json_eql(
api_v3_paths.file_links(work_package.id).to_json
).at_path("_links/fileLinks/href")
expect(last_response.body).to be_json_eql("1").at_path("_embedded/fileLinks/total")
expect(last_response.body).to have_json_path("_links/addFileLink")
end
end
end
Expand Down
Loading