mirror of
https://github.com/WDI-Ideas/rubix.git
synced 2026-04-27 22:55:50 +00:00
14 lines
434 B
JavaScript
14 lines
434 B
JavaScript
// apiSlice.js
|
|
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react';
|
|
const API_URL = import.meta.env.VITE_API_BASE_URL;
|
|
export const blogApi = createApi({
|
|
reducerPath: 'blog',
|
|
baseQuery: fetchBaseQuery({ baseUrl: API_URL + "/api" }),
|
|
endpoints: (builder) => ({
|
|
getBlog: builder.query({
|
|
query: () => 'blog/active',
|
|
}),
|
|
}),
|
|
});
|
|
|
|
export const { useGetBlogQuery } = blogApi; |