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

Remove unnecessary joins from develop branch #645

Closed
Closed
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
e3b2a62
Add subscription user table & entity (#254)
swetha-charles Jan 24, 2023
b24fb04
Merge branch 'develop'
swetha-charles Feb 1, 2023
ee5cc19
Add migration for createdAt and updatedAt fields
swetha-charles Feb 1, 2023
27e13c6
Rename base entity to prevent typeorm clash
swetha-charles Feb 1, 2023
e88e8ac
Merge pull request #263 from chaynHQ/develop
swetha-charles Feb 9, 2023
8fd4628
Merge pull request #267 from chaynHQ/develop
eleanorreem Feb 9, 2023
946ee12
Merge pull request #269 from chaynHQ/develop
eleanorreem Feb 23, 2023
c516351
Merge pull request #273 from chaynHQ/develop
eleanorreem Mar 2, 2023
f76c840
Add return types for subscription-user controller methods
swetha-charles Feb 16, 2023
4e3e1f1
Minor fixes of subscription-user service
swetha-charles Feb 16, 2023
1d863cf
Add accurate log for zapier trigger
swetha-charles Feb 16, 2023
c37d697
Add extra logging for respond.io triggers
swetha-charles Mar 1, 2023
5271394
Fix missing id in subscription response
swetha-charles Mar 1, 2023
3cb2e07
Send subscription name in payload on subscribe
swetha-charles Mar 1, 2023
27dae4a
Send subscription name in payload on unsubscribe
swetha-charles Mar 1, 2023
a13480a
Add better logging for errors
swetha-charles Mar 2, 2023
ad89f3f
Merge pull request #277 from chaynHQ/develop
swetha-charles Mar 9, 2023
29149b4
Merge pull request #280 from chaynHQ/develop
swetha-charles Apr 3, 2023
2358dbe
Merge pull request #282 from chaynHQ/develop
swetha-charles Apr 6, 2023
77d4965
Merge pull request #284 from chaynHQ/develop
eleanorreem Apr 25, 2023
3a10ae7
Merge pull request #288 from chaynHQ/develop
swetha-charles May 29, 2023
d71e297
Merge pull request #290 from chaynHQ/develop
swetha-charles Jun 13, 2023
60fa375
Merge pull request #293 from chaynHQ/develop
swetha-charles Jun 19, 2023
595af2f
Merge pull request #299 from chaynHQ/develop
eleanorreem Jul 31, 2023
f0210b3
Merge pull request #301 from chaynHQ/develop
eleanorreem Aug 8, 2023
09df0f2
Merge pull request #305 from chaynHQ/develop
eleanorreem Aug 31, 2023
764c541
Merge pull request #316 from chaynHQ/develop
eleanorreem Sep 25, 2023
e6a4ff1
Merge pull request #318 from chaynHQ/develop
eleanorreem Sep 26, 2023
f5e7b1b
Merge pull request #327 from chaynHQ/develop
eleanorreem Oct 4, 2023
881a3d3
Merge pull request #334 from chaynHQ/develop
eleanorreem Oct 17, 2023
f8d9be3
Merge pull request #347 from chaynHQ/develop
eleanorreem Oct 31, 2023
b479f4e
Merge pull request #350 from chaynHQ/develop
eleanorreem Nov 7, 2023
64ddea9
Merge pull request #358 from chaynHQ/develop
annarhughes Jan 5, 2024
fb0afb1
Merge pull request #360 from chaynHQ/develop
annarhughes Jan 5, 2024
9883861
Merge pull request #362 from chaynHQ/develop
annarhughes Jan 5, 2024
25c0e08
Merge pull request #364 from chaynHQ/develop
annarhughes Jan 5, 2024
799df82
Merge pull request #366 from chaynHQ/develop
annarhughes Jan 6, 2024
2c391b4
Merge Develop onto Main (#369)
github-actions[bot] Jan 8, 2024
5c547dd
Merge pull request #371 from chaynHQ/develop
annarhughes Jan 8, 2024
fe2ed58
Merge pull request #373 from chaynHQ/develop
annarhughes Jan 8, 2024
d06b9ba
Merge pull request #376 from chaynHQ/develop
annarhughes Jan 8, 2024
b294322
Merge pull request #380 from chaynHQ/develop
annarhughes Jan 9, 2024
8e54699
Merge pull request #384 from chaynHQ/develop
annarhughes Jan 9, 2024
e52085d
Merge pull request #386 from chaynHQ/develop
annarhughes Jan 17, 2024
b9f4371
Merge pull request #391 from chaynHQ/develop
annarhughes Feb 7, 2024
2041fbf
Merge pull request #398 from chaynHQ/develop
annarhughes Feb 16, 2024
c1e4743
Merge pull request #400 from chaynHQ/develop
annarhughes Feb 28, 2024
087efb5
Merge pull request #401 from chaynHQ/develop
annarhughes Apr 15, 2024
6157453
Merge pull request #409 from chaynHQ/develop
annarhughes Apr 15, 2024
bde2126
Merge pull request #411 from chaynHQ/develop
annarhughes Apr 16, 2024
6aa0698
Merge pull request #414 from chaynHQ/develop
annarhughes Apr 17, 2024
45958f5
Merge pull request #416 from chaynHQ/develop
eleanorreem May 9, 2024
a1972e7
Merge pull request #422 from chaynHQ/develop
eleanorreem Jun 3, 2024
208e91c
Merge pull request #447 from chaynHQ/develop
annarhughes Jun 4, 2024
b172adc
Merge pull request #451 from chaynHQ/develop
annarhughes Jun 5, 2024
fb5ce99
Merge pull request #455 from chaynHQ/develop
annarhughes Jun 10, 2024
b784543
Merge pull request #470 from chaynHQ/develop
annarhughes Jun 13, 2024
8ce761e
Merge pull request #477 from chaynHQ/develop
annarhughes Jun 14, 2024
54f9181
Merge pull request #480 from chaynHQ/develop
annarhughes Jun 17, 2024
f50aeb9
Merge pull request #482 from chaynHQ/develop
annarhughes Jun 18, 2024
d7d0a0f
Merge pull request #493 from chaynHQ/develop
annarhughes Jun 24, 2024
2546082
Merge pull request #496 from chaynHQ/develop
annarhughes Jun 25, 2024
33c0f5d
Merge pull request #497 from chaynHQ/develop
eleanorreem Jul 1, 2024
05cc216
Merge pull request #504 from chaynHQ/develop
eleanorreem Jul 3, 2024
0224744
Merge pull request #506 from chaynHQ/develop
annarhughes Jul 3, 2024
f32b31e
Merge pull request #508 from chaynHQ/develop
annarhughes Jul 4, 2024
6e86e5e
Merge pull request #513 from chaynHQ/develop
eleanorreem Jul 8, 2024
18608e0
Merge pull request #518 from chaynHQ/develop
annarhughes Jul 16, 2024
b82ebff
Merge pull request #527 from chaynHQ/develop
eleanorreem Jul 23, 2024
f7c3d34
Merge pull request #552 from chaynHQ/develop
eleanorreem Jul 23, 2024
b639486
Merge pull request #564 from chaynHQ/develop
eleanorreem Aug 14, 2024
8d97ec6
Merge pull request #582 from chaynHQ/develop
annarhughes Aug 14, 2024
6777cd4
Merge remote-tracking branch 'upstream/main' into develop
reidn3r Sep 13, 2024
707fc61
Merge branch 'develop' of github.com:chaynHQ/bloom-backend into develop
reidn3r Sep 19, 2024
d59073d
refactor: remove unnecessary joins in getUserByFirebaseId method
reidn3r Sep 13, 2024
fd0371e
Merge branch 'develop' into remove-unnecessary-joins-from-develop
reidn3r Sep 20, 2024
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
19 changes: 3 additions & 16 deletions src/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,9 @@ export class UserService {
userEntity: UserEntity | undefined;
userDto: GetUserDto | undefined;
}> {
const queryResult = await this.userRepository
.createQueryBuilder('user')
.leftJoinAndSelect('user.partnerAccess', 'partnerAccess')
.leftJoinAndSelect('user.partnerAdmin', 'partnerAdmin')
.leftJoinAndSelect('partnerAccess.therapySession', 'therapySession')
.leftJoinAndSelect('partnerAccess.partner', 'partner')
.leftJoinAndSelect('partnerAccess.partner', 'partnerAccessPartner')
.leftJoinAndSelect('partnerAdmin.partner', 'partnerAdminPartner')
.leftJoinAndSelect('user.courseUser', 'courseUser')
.leftJoinAndSelect('courseUser.course', 'course')
.leftJoinAndSelect('courseUser.sessionUser', 'sessionUser')
.leftJoinAndSelect('sessionUser.session', 'session')
.leftJoinAndSelect('user.subscriptionUser', 'subscriptionUser')
.leftJoinAndSelect('subscriptionUser.subscription', 'subscription')
.where('user.firebaseUid = :uid', { uid })
.getOne();
const queryResult = await this.userRepository.findOneBy({
firebaseUid: uid,
});

if (!queryResult) {
throw new HttpException('USER NOT FOUND', HttpStatus.NOT_FOUND);
Expand Down