Closed
Description
kind of related to #1510
I refactored my code because I want to add dynamic tags to the API,
so I did this :
api.ts :
const api = customCreateApi({
reducerPath: 'API',
baseQuery: baseQueryWithReauth,
endpoints: () => ({}),
});
api.enhanceEndpoints({
addTagTypes: [
'auth/passwordless',
'auth/verify',
'auth/renew',
],
});
export { api };
but now in the individual endpoints files I'm getting a typescript error with provideTags :
const AuthApi = api.injectEndpoints({
endpoints: builder => ({
PasswordlessGet: builder.query<
PasswordlessSuccessResponse,
PasswordlessRequestBody
>({
query: body => {
console.log('running passwordless get');
return {
url: 'auth/passwordless',
method: 'POST',
body: body,
};
},
providesTags: ['auth/passwordless'],
}),
})
})
I will get this error in provideTags
: Type 'string' is not assignable to type 'FullTagDescription<never>'.
What can I do to fix this?
I'm using react-redux@9.1.0
and typescript@5.4.5
Metadata
Metadata
Assignees
Labels
No labels