Files
SSA-Admin-Panel/src/Redux/Service/manage.subadmin.service.ts

33 lines
753 B
TypeScript
Raw Normal View History

import { createApi } from "@reduxjs/toolkit/query/react";
2025-02-10 19:34:29 +05:30
import { baseQueryWithReauth } from "./apiSlice";
export type SubAdminPost = {
id: number;
first_name: string,
last_name: string,
unique_id:string,
date_of_birth:string,
gender: string,
}
2025-02-10 19:34:29 +05:30
export const manageSubAdmin = createApi({
2025-02-10 19:54:18 +05:30
reducerPath: "manageSubAdmin",
2025-02-10 19:34:29 +05:30
baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
tagTypes: ['SubAdmin'],
endpoints: (builder) => ({
getSubAdmin: builder.query<SubAdminPost[], void>({
query: () => `/sub-admin-view/2` }),
2025-02-10 19:34:29 +05:30
}),
});
export const {
useGetSubAdminQuery,
} = manageSubAdmin;
2025-02-10 19:34:29 +05:30
export type Post = {
id: number;
title: string;
body: string;
};