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

Optimize activity channels #1505

Merged
merged 6 commits into from
Sep 15, 2023
Merged

Optimize activity channels #1505

merged 6 commits into from
Sep 15, 2023

Conversation

sausage-todd
Copy link
Contributor

@sausage-todd sausage-todd commented Sep 15, 2023

Changes proposed ✍️

What

🤖 Generated by Copilot at ddba604

This pull request refactors the database and service layers of the backend to improve the handling of activity channels and types for segments and tenants. It removes unused or redundant code, simplifies queries, fixes a bug, and enhances performance. It also updates a test case and an API endpoint to reflect the changes. The main files affected are segmentRepository.ts, tenantRepository.ts, userRepository.ts, activityService.test.ts, segmentService.ts, and authMe.ts.

🤖 Generated by Copilot at ddba604

We are the masters of the segments
We wield the power of the query
We purge the code of obsolete flags
We fix the bugs with raw SQL

Why

How

🤖 Generated by Copilot at ddba604

  • Refactor the logic for fetching and updating activity channels for segments and tenants (link, link, link, link, link, link, link, link, link, link, link, link)
  • Simplify the findById method in UserRepository to use a raw SQL query instead of the findByPk method and remove the conversationSettings association (link, link)
  • Modify the test cases for ActivityService.upsert to use fetchTenantActivityChannels instead of getActivityChannels (link, link)
  • Remove unused imports from segmentRepository.ts and tenantRepository.ts (link, link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screehshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@sausage-todd sausage-todd merged commit 707eb1e into main Sep 15, 2023
9 checks passed
@sausage-todd sausage-todd deleted the optimize-activity-channels branch September 15, 2023 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant