Chore: Move rtk-client generator to scripts (#105548)

* Chore: Move rtk-client generator to scripts

* Fix path

* Update codeowners
This commit is contained in:
Alex Khomenko
2025-05-16 17:58:04 +03:00
committed by GitHub
parent 14d8c5796a
commit 48c5b55cdb
9 changed files with 4 additions and 3 deletions
@@ -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({});