I am having issues passing my environment variables as the url and headers for my axios patch request
const axios = require("axios");
export const handleSubmit = async (formValue, uniquePageName) => {
await axios
.patch(process.env.INTERNAL_RETAILER_CONFIG_UPDATE, formValue, {
headers: {
"Access-Control-Allow-Origin":process.env.INTERNAL_RETAILER_CONFIG_UPDATE,
"x-auth-token":process.env.INTERNAL_TOKEN,
retailername: uniquePageName,
"Content-Type": "application/json",
},
})
.then((res) => {
return res.data;
})
.catch((error) => {
console.log(error);
});
};
I have moved this function inside the api folder and I am calling it on my submit button for on the form. I have attached the error on the console.