This repository was archived by the owner on Aug 21, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Changes for location service hook refactor #9032
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hanzlamateen
suggested changes
Oct 17, 2023
hanzlamateen
suggested changes
Oct 19, 2023
hanzlamateen
approved these changes
Oct 26, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
🤖 Generated by Copilot at 040d9b7
This pull request refactors several database services and their resolvers to use the
KnexServiceclass and its public methods instead of theKnexAdapterclass and its private methods. This improves the query performance, consistency, and maintainability of the code. It also simplifies the service initialization and the access to the app reference. The files affected by this pull request arelocation.class.ts,location.hooks.ts,bot.resolvers.ts,instance-friends.class.ts,instance.class.ts,instance.resolvers.ts, andlocation.ts.References
#8871
Explanation
🤖 Generated by Copilot at 040d9b7
_findand_getmethods with publicfindandgetmethods in various services and resolvers to avoid using internal API offeathersjs/knexadapter and to use standard service interface instead (link, link, link, link)KnexAdapterwithKnexServiceinlocation.class.tsto clean up the code and to use theKnexServiceclass that extends theKnexAdapterclass with custom methods (link, link, link)appproperty fromLocationServiceclass inlocation.class.tsto simplify the class and to avoid storing the app reference in the service instance (link)location.hooks.tsthat are used in the new hooks (link)applyLocationSettingSortfunction tosortByLocationSettingand make it a regular hook instead of a middleware hook inlocation.hooks.tsto use theKnexServicemethods to apply the sorting logic to the query instead of the result (link, link)findandcreatemethods of location service inlocation.hooks.tsto add query parameters, validate and resolve the data, and insert the location data using theKnexServicemethods (link)patchandremovemethods of location service inlocation.hooks.tsto validate and resolve the data, update the location data using theKnexServicemethods, and remove the related location setting and location admin data (link)appparameter fromLocationServiceconstructor call inlocation.tsto simplify the service initialization and to avoid storing the app reference in the service instance (link)🤖 Generated by Copilot at 040d9b7
QA Steps
List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.
Checklist