feat:Add env variables file
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
|
||||
|
||||
const API_URI = import.meta.env.VITE_API_URL;
|
||||
|
||||
export const cropApi = createApi({
|
||||
reducerPath: "cropApi",
|
||||
baseQuery: fetchBaseQuery({
|
||||
baseUrl: "http://localhost:8000/api/v1/crop",
|
||||
baseUrl: `${API_URI}/api/v1/crop`,
|
||||
credentials: "include", // Ensures credentials (cookies, tokens) are included
|
||||
}),
|
||||
tagTypes: ["Crops"],
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
|
||||
|
||||
const API_URI = import.meta.env.VITE_API_URL;
|
||||
|
||||
export const farmApi = createApi({
|
||||
reducerPath: "farmApi",
|
||||
baseQuery: fetchBaseQuery({
|
||||
baseUrl: "http://localhost:8000/api/v1/farm",
|
||||
baseUrl: `${API_URI}/api/v1/farm`,
|
||||
credentials: "include",
|
||||
}),
|
||||
tagTypes: ["Farms"],
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
|
||||
|
||||
const API_URI = import.meta.env.VITE_API_URL;
|
||||
|
||||
export const financeApi = createApi({
|
||||
reducerPath: "financeApi",
|
||||
baseQuery: fetchBaseQuery({
|
||||
baseUrl: "http://localhost:8000/api/v1/finance",
|
||||
baseUrl: `${API_URI}/api/v1/finance`,
|
||||
credentials: "include",
|
||||
}),
|
||||
tagTypes: ["Finance", "Transactions"],
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
|
||||
const API_URI = import.meta.env.VITE_API_URL;
|
||||
|
||||
export const taskApi = createApi({
|
||||
reducerPath: "taskApi",
|
||||
baseQuery: fetchBaseQuery({
|
||||
baseUrl: "http://localhost:8000/api/v1/task",
|
||||
baseUrl: `${API_URI}/api/v1/task`,
|
||||
credentials: "include",
|
||||
}),
|
||||
tagTypes: ["Tasks"],
|
||||
|
||||
Reference in New Issue
Block a user