fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(pinia-colada): fix more bugs

+16 -18
+14
packages/openapi-ts/src/plugins/@pinia/colada/queryKey.ts
··· 399 399 }); 400 400 return statement; 401 401 }; 402 + 403 + export const ensureQueryKeyInfra = ({ 404 + plugin, 405 + state, 406 + }: { 407 + plugin: PiniaColadaPlugin['Instance']; 408 + state: { hasCreateQueryKeyParamsFunction?: boolean }; 409 + }) => { 410 + if (!state.hasCreateQueryKeyParamsFunction) { 411 + createQueryKeyType({ plugin }); 412 + createQueryKeyFunction({ plugin }); 413 + state.hasCreateQueryKeyParamsFunction = true; 414 + } 415 + };
+2 -18
packages/openapi-ts/src/plugins/@pinia/colada/queryOptions.ts
··· 10 10 isOperationOptionsRequired, 11 11 } from '../../shared/utils/operation'; 12 12 import { handleMeta } from './meta'; 13 - import { 14 - createQueryKeyFunction, 15 - createQueryKeyType, 16 - queryKeyStatement, 17 - } from './queryKey'; 13 + import { ensureQueryKeyInfra, queryKeyStatement } from './queryKey'; 18 14 import type { PluginState } from './state'; 19 15 import type { PiniaColadaPlugin } from './types'; 20 16 import { useTypeData } from './useType'; ··· 46 42 state.hasQueries = true; 47 43 } 48 44 49 - if (!state.hasCreateQueryKeyParamsFunction) { 50 - createQueryKeyType({ plugin }); 51 - createQueryKeyFunction({ plugin }); 52 - state.hasCreateQueryKeyParamsFunction = true; 53 - } 45 + ensureQueryKeyInfra({ plugin, state }); 54 46 55 - const symbolUseQueryOptions = f.ensureSymbol({ 56 - name: 'UseQueryOptions', 57 - selector: plugin.api.getSelector('UseQueryOptions'), 58 - }); 59 - f.addImport({ 60 - from: plugin.name, 61 - typeNames: [symbolUseQueryOptions.name], 62 - }); 63 47 f.addImport({ from: plugin.name, names: ['defineQueryOptions'] }); 64 48 65 49 state.hasUsedQueryFn = true;