Chore: Move rtk-client generator to scripts (#105548)
* Chore: Move rtk-client generator to scripts * Fix path * Update codeowners
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { createApi } from '@reduxjs/toolkit/query/react';
|
||||
|
||||
import { createBaseQuery } from 'app/api/createBaseQuery';
|
||||
import { getAPIBaseURL } from 'app/api/utils';
|
||||
|
||||
export const BASE_URL = getAPIBaseURL('{{group}}', '{{version}}');
|
||||
|
||||
export const api = createApi({
|
||||
reducerPath: '{{reducerPath}}',
|
||||
baseQuery: createBaseQuery({
|
||||
baseURL: BASE_URL,
|
||||
}),
|
||||
endpoints: () => ({}),
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
'{{apiPathPrefix}}/{{groupName}}/endpoints.gen.ts': {
|
||||
apiFile: '{{apiPathPrefix}}/{{groupName}}/baseAPI.ts',
|
||||
schemaFile: '../data/openapi/{{group}}-{{version}}.json',
|
||||
{{#if endpoints}}
|
||||
filterEndpoints: [{{{formatEndpoints endpoints}}}],
|
||||
{{/if}}
|
||||
tag: true,
|
||||
},
|
||||
// PLOP_INJECT_API_CLIENT - Used by the API client generator
|
||||
@@ -0,0 +1,3 @@
|
||||
import { generatedAPI } from './endpoints.gen';
|
||||
|
||||
export const {{reducerPath}} = generatedAPI.enhanceEndpoints({});
|
||||
Reference in New Issue
Block a user