@@ -48,21 +48,6 @@ export const templates = (
48
48
} ;
49
49
} ;
50
50
51
- const getTemplatesByOrganizationQueryKey = (
52
- organization : string ,
53
- options ?: GetTemplatesOptions ,
54
- ) => [ organization , "templates" , options ?. deprecated ] ;
55
-
56
- const templatesByOrganization = (
57
- organization : string ,
58
- options : GetTemplatesOptions = { } ,
59
- ) => {
60
- return {
61
- queryKey : getTemplatesByOrganizationQueryKey ( organization , options ) ,
62
- queryFn : ( ) => API . getTemplatesByOrganization ( organization , options ) ,
63
- } ;
64
- } ;
65
-
66
51
export const templateACL = ( templateId : string ) => {
67
52
return {
68
53
queryKey : [ "templateAcl" , templateId ] ,
@@ -121,9 +106,11 @@ export const templateExamples = () => {
121
106
} ;
122
107
} ;
123
108
109
+ export const templateVersionRoot : string = "templateVersion"
110
+
124
111
export const templateVersion = ( versionId : string ) => {
125
112
return {
126
- queryKey : [ "templateVersion" , versionId ] ,
113
+ queryKey : [ templateVersionRoot , versionId ] ,
127
114
queryFn : ( ) => API . getTemplateVersion ( versionId ) ,
128
115
} ;
129
116
} ;
@@ -134,7 +121,7 @@ export const templateVersionByName = (
134
121
versionName : string ,
135
122
) => {
136
123
return {
137
- queryKey : [ "templateVersion" , organizationId , templateName , versionName ] ,
124
+ queryKey : [ templateVersionRoot , organizationId , templateName , versionName ] ,
138
125
queryFn : ( ) =>
139
126
API . getTemplateVersionByName ( organizationId , templateName , versionName ) ,
140
127
} ;
@@ -153,7 +140,7 @@ export const templateVersions = (templateId: string) => {
153
140
} ;
154
141
155
142
export const templateVersionVariablesKey = ( versionId : string ) => [
156
- "templateVersion" ,
143
+ templateVersionRoot ,
157
144
versionId ,
158
145
"variables" ,
159
146
] ;
@@ -216,7 +203,7 @@ export const templaceACLAvailable = (
216
203
} ;
217
204
218
205
const templateVersionExternalAuthKey = ( versionId : string ) => [
219
- "templateVersion" ,
206
+ templateVersionRoot ,
220
207
versionId ,
221
208
"externalAuth" ,
222
209
] ;
@@ -257,21 +244,21 @@ const createTemplateFn = async (options: CreateTemplateOptions) => {
257
244
258
245
export const templateVersionLogs = ( versionId : string ) => {
259
246
return {
260
- queryKey : [ "templateVersion" , versionId , "logs" ] ,
247
+ queryKey : [ templateVersionRoot , versionId , "logs" ] ,
261
248
queryFn : ( ) => API . getTemplateVersionLogs ( versionId ) ,
262
249
} ;
263
250
} ;
264
251
265
252
export const richParameters = ( versionId : string ) => {
266
253
return {
267
- queryKey : [ "templateVersion" , versionId , "richParameters" ] ,
254
+ queryKey : [ templateVersionRoot , versionId , "richParameters" ] ,
268
255
queryFn : ( ) => API . getTemplateVersionRichParameters ( versionId ) ,
269
256
} ;
270
257
} ;
271
258
272
259
export const resources = ( versionId : string ) => {
273
260
return {
274
- queryKey : [ "templateVersion" , versionId , "resources" ] ,
261
+ queryKey : [ templateVersionRoot , versionId , "resources" ] ,
275
262
queryFn : ( ) => API . getTemplateVersionResources ( versionId ) ,
276
263
} ;
277
264
} ;
@@ -293,7 +280,7 @@ export const previousTemplateVersion = (
293
280
) => {
294
281
return {
295
282
queryKey : [
296
- "templateVersion" ,
283
+ templateVersionRoot ,
297
284
organizationId ,
298
285
templateName ,
299
286
versionName ,
@@ -313,7 +300,7 @@ export const previousTemplateVersion = (
313
300
314
301
export const templateVersionPresets = ( versionId : string ) => {
315
302
return {
316
- queryKey : [ "templateVersion" , versionId , "presets" ] ,
303
+ queryKey : [ templateVersionRoot , versionId , "presets" ] ,
317
304
queryFn : ( ) => API . getTemplateVersionPresets ( versionId ) ,
318
305
} ;
319
306
} ;
0 commit comments