add teamId and userId to network request

This commit is contained in:
Alex Holliday committed 2025-02-10 10:21:56 -08:00
1 parent 99079cc2bb
commit f78343d03f
1 file changed
+4 -2
+4 -2
View File
@@ -1,5 +1,5 @@
import axios from "axios"; import axios from "axios";
import i18next from 'i18next'; import i18next from "i18next";
const BASE_URL = import.meta.env.VITE_APP_API_BASE_URL; const BASE_URL = import.meta.env.VITE_APP_API_BASE_URL;
const FALLBACK_BASE_URL = "http://localhost:5000/api/v1"; const FALLBACK_BASE_URL = "http://localhost:5000/api/v1";
import { clearAuthState } from "../Features/Auth/authSlice"; import { clearAuthState } from "../Features/Auth/authSlice";
@@ -26,7 +26,7 @@ class NetworkService {
}); });
this.axiosInstance.interceptors.request.use( this.axiosInstance.interceptors.request.use(
(config) => { (config) => {
const currentLanguage = i18next.language || 'en'; const currentLanguage = i18next.language || "en";
config.headers = { config.headers = {
...config.headers, ...config.headers,
@@ -1003,6 +1003,8 @@ class NetworkService {
async createStatusPage(config) { async createStatusPage(config) {
const { authToken, user, form, isCreate } = config; const { authToken, user, form, isCreate } = config;
const fd = new FormData(); const fd = new FormData();
fd.append("teamId", user.teamId);
fd.append("userId", user._id);
form.isPublished && fd.append("isPublished", form.isPublished); form.isPublished && fd.append("isPublished", form.isPublished);
form.companyName && fd.append("companyName", form.companyName); form.companyName && fd.append("companyName", form.companyName);
form.url && fd.append("url", form.url); form.url && fd.append("url", form.url);