Files
SSA-Admin-Panel/src/Redux/Service/master.module.service.ts

26 lines
521 B
TypeScript
Raw Normal View History

2025-02-10 19:34:29 +05:30
import { createApi } from "@reduxjs/toolkit/query";
import { baseQueryWithReauth } from "./apiSlice";
2025-02-10 19:54:18 +05:30
export const masterModule = createApi({
reducerPath: "masterModule",
2025-02-10 19:34:29 +05:30
baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
endpoints: (builder) => ({
getPosts: builder.query<Post[], void>({ query: () => "/posts" }),
}),
});
2025-02-10 19:54:18 +05:30
export const { } = masterModule;
2025-02-10 19:34:29 +05:30
export type Post = {
id: number;
title: string;
body: string;
};