Repository navigation
Conversation
Pull Request Test Coverage Report for Build 17044955138Details
💛 - Coveralls |
|
@aaqilniz, thanks for the PR. Could you please add tests? Thanks. |
c231cb7 to
fcc2690
Compare
|
Hi, @dhmlau. Can you please have a look at the PR now? I have added tests to verify the changes. Thanks. |
765d496 to
15e2edf
Compare
Signed-off-by: Muhammad Aaqil <aaqilcs102@gmail.com>
15e2edf to
f26f910
Compare
samarpanB
left a comment
There was a problem hiding this comment.
I am requesting changes because the PR forwards controller configuration into repository operation options, which crosses architectural responsibilities and does not demonstrate propagation of any request-scoped context. Please see the inline review for details.
| filter?: Filter<T>, | ||
| ): Promise<(T & Relations)[]> { | ||
| return this.repository.find(filter); | ||
| return this.repository.find(filter, options); |
There was a problem hiding this comment.
I'm concerned about the design of this change.
The options argument passed to defineCrudRestController() is controller configuration (basePath, readonly), not repository operation options.
By forwarding this object to every repository method, we're mixing REST-layer configuration with data-access concerns.
The PR description mentions transaction contexts and execution options, but I don't see how those would be available through this static controller configuration.
Could we clarify the actual use case this is intended to solve? If we need to propagate request-specific repository options, they should come from an appropriate execution context rather than the controller's configuration.
I'm also not seeing why this change is required for the referencesMany filtering issue. Can we demonstrate that dependency before making a cross-cutting change to all CRUD operations?
I would suggest reconsidering the approach rather than forwarding the existing options object.
This PR updates
defineCrudRestControllerto 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 the correct argument offsets.
Added unit tests verifying correct options propagation and argument positioning across repository method calls.
Checklist
npm testpasses on your machinepackages/cliwere updatedexamples/*were updated👉 Check out how to submit a PR 👈