first commit

This commit is contained in:
2026-03-10 14:55:59 +05:30
commit 39d42663c0
134 changed files with 16311 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
// src/features/reports/inventoryAPI.js
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
export const inventoryApi = createApi({
reducerPath: "inventoryApi",
baseQuery: fetchBaseQuery({
baseUrl: import.meta.env.VITE_API_URL || "http://localhost:5000/api",
prepareHeaders: (headers) => {
const token = localStorage.getItem("token");
if (token) headers.set("Authorization", `Bearer ${token}`);
return headers;
},
}),
endpoints: (builder) => ({
getInventoryStats: builder.query({
query: () => "/admin/reports/inventory",
}),
}),
});
export const { useGetInventoryStatsQuery } = inventoryApi;