33 lines
753 B
TypeScript
33 lines
753 B
TypeScript
import { createApi } from "@reduxjs/toolkit/query/react";
|
|
import { baseQueryWithReauth } from "./apiSlice";
|
|
|
|
|
|
|
|
export type SubAdminPost = {
|
|
id: number;
|
|
first_name: string,
|
|
last_name: string,
|
|
unique_id:string,
|
|
date_of_birth:string,
|
|
gender: string,
|
|
}
|
|
|
|
export const manageSubAdmin = createApi({
|
|
reducerPath: "manageSubAdmin",
|
|
baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
|
|
tagTypes: ['SubAdmin'],
|
|
endpoints: (builder) => ({
|
|
getSubAdmin: builder.query<SubAdminPost[], void>({
|
|
query: () => `/sub-admin-view/2` }),
|
|
}),
|
|
});
|
|
|
|
export const {
|
|
useGetSubAdminQuery,
|
|
} = manageSubAdmin;
|
|
|
|
export type Post = {
|
|
id: number;
|
|
title: string;
|
|
body: string;
|
|
}; |