26 lines
497 B
TypeScript
26 lines
497 B
TypeScript
import { createApi } from "@reduxjs/toolkit/query";
|
|
import { baseQueryWithReauth } from "./apiSlice";
|
|
|
|
export const faqs = createApi({
|
|
reducerPath: "faqs",
|
|
baseQuery: baseQueryWithReauth, // Use enhanced baseQuery with error handling
|
|
endpoints: (builder) => ({
|
|
|
|
|
|
|
|
getPosts: builder.query<Post[], void>({ query: () => "/posts" }),
|
|
|
|
|
|
|
|
|
|
|
|
}),
|
|
});
|
|
|
|
export const { } = faqs;
|
|
|
|
export type Post = {
|
|
id: number;
|
|
title: string;
|
|
body: string;
|
|
}; |