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

Scoped repo refactor #6270

Merged
merged 5 commits into from
Dec 19, 2024
Merged

Scoped repo refactor #6270

merged 5 commits into from
Dec 19, 2024

Conversation

RubenGeo
Copy link
Contributor

@RubenGeo RubenGeo commented Dec 9, 2024

AB#32022

This refactor is needed because we sort of initialized scoped repository twice in the old appoach:

 export class RegistrationDataScopedRepository extends ScopedRepository<RegistrationAttributeDataEntity> {
  constructor(
    @Inject(REQUEST) request: ScopedUserRequest,
    @InjectRepository(RegistrationAttributeDataEntity)
    scopedRepository: ScopedRepository<RegistrationAttributeDataEntity>,
  ) {
    super(request, scopedRepository);
  }

Here RegistrationDataScopedRepository already extents ScopedRepository passing it in as argument in the constructor is giving ScopedRepository another ScopedRepository. It's like wrapping it twice. I think it never gave us issues because the internal defined methods (like 'findOne') are also overwritten twice.

Describe your changes

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have added tests wherever relevant
  • I have made sure that all automated checks pass before requesting a review
  • I do not need any deviation from our PR guidelines

@RubenGeo RubenGeo added the chore Something that does not affect the end user label Dec 9, 2024
@RubenGeo RubenGeo enabled auto-merge (squash) December 13, 2024 14:46
@RubenGeo RubenGeo enabled auto-merge (squash) December 19, 2024 15:34
Signed-off-by: Ruben <[email protected]>
@RubenGeo RubenGeo merged commit a97ca5e into main Dec 19, 2024
6 checks passed
@RubenGeo RubenGeo deleted the refactor.scoped branch December 19, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Something that does not affect the end user
Development

Successfully merging this pull request may close these issues.

3 participants