This repository was archived by the owner on Feb 12, 2025. It is now read-only.
File tree 2 files changed +10
-6
lines changed
2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,13 @@ export const buildItemInvitationsKey = (id?: UUID) => [
135
135
'invitations' ,
136
136
] ;
137
137
138
+ export const PLANS_KEY = 'plans' ;
139
+ export const OWN_PLAN_KEY = 'ownPlan' ;
140
+ export const buildPlanKey = ( id : string ) => [ MEMBERS_KEY , id , 'plans' ] ;
141
+ export const buildPlansKey = ( id : string ) => [ MEMBERS_KEY , id , 'plans' ] ;
142
+ export const CARDS_KEY = 'cards' ;
143
+ export const CURRENT_CUSTOMER_KEY = 'currentCustomer' ;
144
+
138
145
export const DATA_KEYS = {
139
146
APPS_KEY ,
140
147
ITEMS_KEY ,
@@ -182,12 +189,8 @@ export const DATA_KEYS = {
182
189
buildItemValidationGroupsKey,
183
190
buildInvitationKey,
184
191
buildItemInvitationsKey,
192
+ buildPlanKey,
185
193
} ;
186
- export const PLANS_KEY = 'plans' ;
187
- export const OWN_PLAN_KEY = 'ownPlan' ;
188
- export const buildPlansKey = ( id : string ) => [ MEMBERS_KEY , id , 'plans' ] ;
189
- export const CARDS_KEY = 'cards' ;
190
- export const CURRENT_CUSTOMER_KEY = 'currentCustomer' ;
191
194
192
195
export const MUTATION_KEYS = {
193
196
POST_ITEM : 'postItem' ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { Map, List } from 'immutable';
3
3
import { QueryClientConfig } from '../types' ;
4
4
import * as Api from '../api' ;
5
5
import {
6
+ buildPlanKey ,
6
7
CARDS_KEY ,
7
8
CURRENT_CUSTOMER_KEY ,
8
9
OWN_PLAN_KEY ,
@@ -19,7 +20,7 @@ export default (queryConfig: QueryClientConfig) => {
19
20
20
21
const usePlan = ( { planId } : { planId : string } ) =>
21
22
useQuery ( {
22
- queryKey : PLANS_KEY ,
23
+ queryKey : buildPlanKey ( planId ) ,
23
24
queryFn : ( ) =>
24
25
Api . getPlan ( { planId } , queryConfig ) . then ( ( data ) => Map ( data ) ) ,
25
26
...defaultOptions ,
You can’t perform that action at this time.
0 commit comments