fix: move the me endpoint to generic useApiQuery

This commit is contained in:
mengstabketemaw
2026-07-08 14:15:13 +03:00
parent c106ac68d4
commit de37c6940e
4 changed files with 10 additions and 14 deletions

View File

@@ -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: () => ({}),
});

View File

@@ -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,