Update frontend for user-policy API v2 compatibility#574
Merged
anth-volk merged 11 commits intomove-to-api-v2from Feb 17, 2026
Merged
Update frontend for user-policy API v2 compatibility#574anth-volk merged 11 commits intomove-to-api-v2from
anth-volk merged 11 commits intomove-to-api-v2from
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
453e390 to
c45a49f
Compare
Remove isMigrationComplete, markMigrationComplete, clearMigrationFlag, and MIGRATION_COMPLETE storage key. Migration functionality will be built separately once all ingredient APIs are properly set up. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create api/v2/userPolicyAssociations.ts with types, conversion functions, and CRUD operations mirroring the household v2 module. Refactor ApiPolicyStore to delegate to v2 functions instead of inline fetch calls. Add userId param to update/delete for backend ownership verification. Remove deprecated v1 code: PolicyAdapter.fromMetadata/toCreationPayload, UserPolicyAdapter, PolicyCreationPayload, UserPolicyCreationPayload, userPolicyMetadata types, and dead countParameterChanges function. Replace toCreationPayload usage in report pages with direct convertParametersToPolicyJson calls. Fix queryKeys bug (model -> country label), add useDeletePolicyAssociation hook, and update test fixtures with countryId. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
anth-volk
approved these changes
Feb 17, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Aligns frontend with backend PR #71 which adds user-policy association CRUD endpoints.
Changes
API endpoints:
/api/user-policy-associationsto/user-policiesfindByUsernow uses query params:/user-policies/?user_id=xxx&country_id=xxxfindByIdchanged from(userId, policyId)to(userPolicyId)Types:
idfield toUserPolicyMetadata(association ID from backend)created_atandupdated_atrequired in responseUserPolicyUpdateMetadatafor PATCH requestsupdated_atfrom creation payloadImplementation:
UserPolicyAdapter.fromApiResponseto useapiData.idinstead ofapiData.policy_idupdatemethod with PATCH/user-policies/{id}deletemethod with DELETE/user-policies/{id}LocalStoragePolicyStoreto match new interfaceTest plan