Skip to content

fix: propagate options parameter across all controller methods - #11146

Open
aaqilniz wants to merge 3 commits into
loopbackio:masterfrom
aaqilniz:fix/pass-options
Open

aaqilniz wants to merge 3 commits into
loopbackio:masterfrom
aaqilniz:fix/pass-options

Conversation

@aaqilniz

@aaqilniz aaqilniz commented Aug 18, 2025 •

Copy link
Copy Markdown
Contributor

This PR updates defineCrudRestController to forward the controller-level options configuration to all underlying repository methods.

Previously, none of the CRUD REST controller methods were passing the options parameter down to their respective repository calls, meaning any configuration, transaction contexts, or execution options available at the controller level were entirely dropped.

Changes Made

Updated all generated CRUD controller methods that were not forwarding the options to forward the closure-scoped options parameter to the corresponding repository methods at their correct argument offsets.

Added unit tests verifying correct options propagation and argument positioning across repository method calls.

Checklist

  • DCO (Developer Certificate of Origin) signed in all commits
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 17044955138

Details

  • 1 of 2 (50.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 54.475%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/rest-crud/src/crud-rest.controller.ts 1 2 50.0%
Totals Coverage Status
Change from base Build 17030337281: 0.0%
Covered Lines: 9572
Relevant Lines: 12457

💛 - Coveralls

@dhmlau

dhmlau commented Sep 22, 2025

Copy link
Copy Markdown
Member

@aaqilniz, thanks for the PR. Could you please add tests? Thanks.

@dhmlau dhmlau added the need-tests Need to add tests in the PR label Sep 22, 2025
@aaqilniz
aaqilniz marked this pull request as draft October 18, 2026 04:41
Signed-off-by: Muhammad Aaqil <aaqilcs102@gmail.com>
Signed-off-by: Muhammad Aaqil <aaqilcs102@gmail.com>
Signed-off-by: Muhammad Aaqil <aaqilcs102@gmail.com>
@aaqilniz aaqilniz changed the title fix: pass options to repository methods fix: propagate options parameter across all controller methods Oct 31, 2026
@aaqilniz
aaqilniz marked this pull request as ready for review October 31, 2026 05:03
@aaqilniz

Copy link
Copy Markdown
Contributor Author

Hi, @dhmlau. Can you please have a look at the PR now? I have added tests to verify the changes. Thanks.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need-tests Need to add tests in the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants