Skip to content

added keyfactory for where mutations exist#307

Merged
zalexa19 merged 5 commits intomainfrom
task-298-adding-key-factory
Feb 21, 2026
Merged

added keyfactory for where mutations exist#307
zalexa19 merged 5 commits intomainfrom
task-298-adding-key-factory

Conversation

@zalexa19
Copy link
Contributor

I added a key factory for every feature that invalidates queries

#298

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements query key factories for trainee-profile features as part of standardizing the TanStack Query implementation across the codebase. It centralizes query invalidation logic by moving it from components into mutation hooks, improving maintainability and consistency.

Changes:

  • Added query key factory files (keys.ts) for personal-info, interactions, and tests features
  • Updated mutation hooks to use key factories for query invalidation
  • Removed manual query invalidation from components (TraineeProfile and TestsComponent)

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
client/src/features/trainee-profile/personal-info/data/keys.ts New query key factory for trainee personal info with details() method
client/src/features/trainee-profile/interactions/data/keys.ts New query key factory for interactions with list() method
client/src/features/trainee-profile/education/tests/data/keys.ts New query key factory for tests with list() method
client/src/features/trainee-profile/personal-info/data/useTraineeInfoData.tsx Updated to import and use trainee key factory; added query invalidation to mutation
client/src/features/trainee-profile/interactions/data/interaction-queries.ts Updated all mutations to use interaction key factory for invalidation
client/src/features/trainee-profile/education/tests/data/test-queries.ts Updated all mutations to use test key factory for invalidation
client/src/features/trainee-profile/profile/components/TraineeProfile.tsx Removed manual query invalidation and unused queryClient
client/src/features/trainee-profile/education/tests/TestsComponent.tsx Removed manual query invalidation and unused queryClient

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@HackYourFutures HackYourFutures temporarily deployed to dojo-task-298-adding-ke-k6bhnv February 21, 2026 20:18 Inactive
@zalexa19 zalexa19 merged commit 8979774 into main Feb 21, 2026
1 check passed
@zalexa19 zalexa19 deleted the task-298-adding-key-factory branch February 21, 2026 20:20
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.

4 participants