mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-27 17:50:56 +00:00
fix: move the me endpoint to generic useApiQuery
This commit is contained in:
@@ -4,6 +4,6 @@ import { baseQueryWithReauth } from './base-query-with-reauth';
|
||||
export const baseApi = createApi({
|
||||
reducerPath: 'baseApi',
|
||||
baseQuery: baseQueryWithReauth,
|
||||
tagTypes: ['Api', 'Me'],
|
||||
tagTypes: ['Api'],
|
||||
endpoints: () => ({}),
|
||||
});
|
||||
|
||||
@@ -22,15 +22,11 @@ const queryApi = baseApi.injectEndpoints({
|
||||
headers,
|
||||
}),
|
||||
}),
|
||||
getMe: builder.query<unknown, void>({
|
||||
query: () => '/auth/me',
|
||||
providesTags: ['Me'],
|
||||
}),
|
||||
}),
|
||||
overrideExisting: false,
|
||||
});
|
||||
|
||||
export const { useApiQueryQuery, useApiMutationMutation, useGetMeQuery } = queryApi;
|
||||
export const { useApiQueryQuery, useApiMutationMutation } = queryApi;
|
||||
|
||||
export function useApiQuery<TData = unknown>(
|
||||
args: ApiQueryArgs,
|
||||
|
||||
Reference in New Issue
Block a user