Skip to content

Commit

Permalink
update proxy configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Chanuka-ChandraYapa committed Oct 7, 2023
1 parent 39119ce commit c141ea4
Show file tree
Hide file tree
Showing 24 changed files with 105 additions and 70 deletions.
75 changes: 37 additions & 38 deletions .firebase/hosting.YnVpbGQ.cache
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,40 @@ brand-dark.png,1694254597736,702452b4806f73230e4931aa592272e2b575041e860562fa40f
favicon.png,1691226006659,98a04f7e56d94a7501464028a58de35b8c75edd22190662dd1c9a7d4506f9011
manifest.json,1694287199372,c83ecda918bbbda0c2ddf51f5dc7a3a681e7ce84438985e201e7a843e8f47ec9
robots.txt,1691226006661,b2090cf9761ef60aa06e4fab97679bd43dfa5e5df073701ead5879d7c68f1ec5
404.html,1694805319319,daa499dd96d8229e73235345702ba32f0793f0c8e5c0d30e40e37a5872be57aa
index.html,1694805237394,e24573b506bdd3a476e2070f4da2104853d85e76ac25cc863153cddc69f5f9dd
asset-manifest.json,1694805237465,f99cbb5a1968c0fafb65daba257f7446b751b7379b361e7fb51ebef16d8f90ac
static/css/main.21be9e29.css,1694805237395,055e9e85a0610e176e38ad174690ec4ff6808dd57ce88dbc54175c0171a16476
static/js/703.68ff776a.chunk.js.LICENSE.txt,1694805237395,3d8cec7287cdb0530baa88a78b7810defffd2f56cc2cccf447bc5889a622b212
static/js/703.68ff776a.chunk.js,1694805237465,e83256c6d19bf02880f9ae9f36584c69b9e491beecec0ceb1c5ac14b85c882e3
static/css/main.21be9e29.css.map,1694805237465,386851af591d5f1544327c513e505eaf17e86e607bf4af9d607488d2db10b9c6
static/js/main.0dc7a167.js.LICENSE.txt,1694805237395,20488bf5da16a483592651d1696300dd006944aa4bba15bece1383c3119057f9
static/media/icon-blacklist.00461066f8dc77314608696b24ffca29.svg,1694805237376,23ec3e3fe5106041541173ea5bd667cebac2d62471759db00f4a4f9a99b65a8e
static/media/icon-facebook.7e5a10f05d754f6e65372e20a5452d60.svg,1694805237377,e886d6d8420e8ea3f5d92b3e4411d690cbf59db4b1c32c6baaf7fe0faebc1847
static/media/icon-text.72e88c25f84b1cf1d3f69a697f689f64.svg,1694805237377,8c54c677a8fc3e9d0b054ebf7a46ae3573df7219603b04d736099fba7ea51efc
static/media/icon-instagram.6916c290ec7f973be569508e95332846.svg,1694805237377,63d77fac1a784b57ac66383f2265c103bcdc61bb484ff50b344b970473ea452a
static/media/icon-preview.9d260cdcabe46fdc423492bfe2e317cf.svg,1694805237376,2e1fc9d039149ef375d54d7276089c55ff21f2504139c79859349613a6b31619
static/media/icon-twitter.09334153919ab7925dce3b54b4b9a815.svg,1694805237376,76bca9231586ca4c6fd04e7a2740cf1b0bdf8699094689df819e0eb50d57a3b2
static/media/bruce-mars.8a606c4a6dab54c9ceff.jpg,1694805237376,b9d6660122b20a8a6fb1b6e7ea4d9b575b2ed1e9d86fe66e9ef7bbbc4804b964
static/media/house.ce4190cf14822c2257b0.png,1694805237394,71651ecfee60076c2d84abd0128f2716b944250d4f529224f2724db4ebfcdb29
static/media/logowithbrand.1e0479210ed4f2cd2af0.png,1694805237395,f1be59932f15bcc82152ef5f33a69abebcdb1ef28d5b929805acaf810ba17758
static/media/land.a180af0f55ec7508e106.png,1694805237394,ea3f98c35afa9311618ee456466cbc0e1927b4488fa6d7026c902146e597868c
static/js/703.68ff776a.chunk.js.map,1694805237490,5a0ff7437240593cc20bb51e55130a6d746b07e30495804530095587227ce082
static/media/marriage.7b26dbac84b6fb70b91e.png,1694805237394,eefda79f94949d6e5dfdfbeba1c84cbb8101058ff92e3131e7da6b562711f2e5
static/media/mastercard.27fca3e7637a9458fb64.png,1694805237377,2015bca51ddb5859ebb94d73d1802bf322d2f7e544c0a2fbc3500fd992af8500
static/media/visa.71c0d5e9e2aaee42e4c3.png,1694805237377,5675d0bb0a46ef1c343090c0b9ba4d2b398c937b72909a7fcd1c959e36dc784f
static/js/513.c3183f67.chunk.js,1694805237465,3ffbee61e1e12b2ac876d96a8aa82288d705827c4bd232805d09e4d26b19f184
static/media/image-devices.7a9f93355333984b7941.png,1694805237395,db97ae84ccd9a09052017c203e159e7f57d14b473ce5d6095f4b2ff31a047ef8
static/media/bg-header-desktop.3d39ff8e4eec581d1f91.png,1694805237377,6a8849446474587badf86ebf0d58bcf72aef1a680157d90c7cf5b471647da918
static/media/image-computer.65db67db202be4e74616.png,1694805237395,a221118a6e05fc3c24fd4b56839206ab412de9339a853610d20ad142fac73e53
static/js/513.c3183f67.chunk.js.map,1694805237492,0d4d4ba2f497ad3d0cb01e42846812c45900da1978e557b7a5301f8159fb8f5b
static/media/bg-profile.af1219a742e09fc7b612.jpeg,1694805237377,c0224651329e6f23cbe3bd9bfb37986a67de3566a837197af7ba31eb5bf2a928
static/media/house (1).1c4662866d6ca3755cf4.jpg,1694805237377,8610be21401a79ecd5b0448b81190772e7b6e2504a455c9eaf6eb5d2982bb044
static/media/wedding.72b9ec574465c95d19b9.jpg,1694805237395,c45f2c6592cab0cd42dd8d03cab88adaf91ce7aa2ecbf707fa93ca6fa84cfe1f
static/media/newspaper2.d4dec8c732058acfeec1.jpg,1694805237395,3a7a10c19aa48d4ad2c2678da165da3a0d59dd6ef638b2e71cb3af37928b83fa
static/media/background3.3ce0efefbd5f55c07b58.png,1694805237395,4b0f57791be4038375c5d4c7039357793e0c19837615de31b2b8ee60a3aedfc9
static/media/land.545d66910852fb567f29.jpg,1694805237377,b76f1b1f28de91e7e91995c23f05d6dc5d77035402e3f1034be96384f6ec1004
static/js/main.0dc7a167.js,1694805237465,5c43616e6c17783cffd071b85d210acf66e7e384e3241e3bf64e71d47d7917b6
static/media/pattern-tree.431da656681abcdffac51bee04d7f581.svg,1694805237401,077b4cad6cd72eaf768124ce97b66451dabf05a04e422c8cb4452f887b8b8ebb
static/media/background.b28e08e8c97c1c73b13f.jpg,1694805237377,364ba257eb402e2e6a69bfd7544679734f3c62a719f015fa6c499238f87e9b1a
static/media/newspaper1.d9cb92762b7f143bf29b.jpg,1694805237395,dbd7a8fdf1f7f03040c6e6c8dc5d13e3726fc1b243ebeea59e9ceb35e7936e42
static/js/main.0dc7a167.js.map,1694805237497,1d82164ed36084e539fe608584363539a87edfbc0acabc0a251ce6f1b0990f13
asset-manifest.json,1696704887805,0d13e7a32d08d695f4b747318eb053620d05d83576e75808a6878fc13f912960
index.html,1696704887742,525ad697503150d7f3c27ebd21123bde910e4236c9cf7e8e62d5d89f84753170
static/css/main.21be9e29.css,1696704887747,055e9e85a0610e176e38ad174690ec4ff6808dd57ce88dbc54175c0171a16476
static/css/main.21be9e29.css.map,1696704887805,386851af591d5f1544327c513e505eaf17e86e607bf4af9d607488d2db10b9c6
static/js/703.68ff776a.chunk.js,1696704887805,e83256c6d19bf02880f9ae9f36584c69b9e491beecec0ceb1c5ac14b85c882e3
static/js/703.68ff776a.chunk.js.LICENSE.txt,1696704887745,3d8cec7287cdb0530baa88a78b7810defffd2f56cc2cccf447bc5889a622b212
static/js/main.9796e417.js.LICENSE.txt,1696704887745,20488bf5da16a483592651d1696300dd006944aa4bba15bece1383c3119057f9
static/media/icon-blacklist.00461066f8dc77314608696b24ffca29.svg,1696704887727,23ec3e3fe5106041541173ea5bd667cebac2d62471759db00f4a4f9a99b65a8e
static/media/icon-facebook.7e5a10f05d754f6e65372e20a5452d60.svg,1696704887729,e886d6d8420e8ea3f5d92b3e4411d690cbf59db4b1c32c6baaf7fe0faebc1847
static/media/icon-instagram.6916c290ec7f973be569508e95332846.svg,1696704887730,63d77fac1a784b57ac66383f2265c103bcdc61bb484ff50b344b970473ea452a
static/media/icon-preview.9d260cdcabe46fdc423492bfe2e317cf.svg,1696704887729,2e1fc9d039149ef375d54d7276089c55ff21f2504139c79859349613a6b31619
static/media/icon-text.72e88c25f84b1cf1d3f69a697f689f64.svg,1696704887727,8c54c677a8fc3e9d0b054ebf7a46ae3573df7219603b04d736099fba7ea51efc
static/media/icon-twitter.09334153919ab7925dce3b54b4b9a815.svg,1696704887731,76bca9231586ca4c6fd04e7a2740cf1b0bdf8699094689df819e0eb50d57a3b2
static/media/bruce-mars.8a606c4a6dab54c9ceff.jpg,1696704887731,b9d6660122b20a8a6fb1b6e7ea4d9b575b2ed1e9d86fe66e9ef7bbbc4804b964
static/media/house.ce4190cf14822c2257b0.png,1696704887742,71651ecfee60076c2d84abd0128f2716b944250d4f529224f2724db4ebfcdb29
static/media/logowithbrand.1e0479210ed4f2cd2af0.png,1696704887745,f1be59932f15bcc82152ef5f33a69abebcdb1ef28d5b929805acaf810ba17758
static/js/703.68ff776a.chunk.js.map,1696704887806,5a0ff7437240593cc20bb51e55130a6d746b07e30495804530095587227ce082
static/media/land.a180af0f55ec7508e106.png,1696704887742,ea3f98c35afa9311618ee456466cbc0e1927b4488fa6d7026c902146e597868c
static/media/marriage.7b26dbac84b6fb70b91e.png,1696704887742,eefda79f94949d6e5dfdfbeba1c84cbb8101058ff92e3131e7da6b562711f2e5
static/media/mastercard.27fca3e7637a9458fb64.png,1696704887732,2015bca51ddb5859ebb94d73d1802bf322d2f7e544c0a2fbc3500fd992af8500
static/media/visa.71c0d5e9e2aaee42e4c3.png,1696704887732,5675d0bb0a46ef1c343090c0b9ba4d2b398c937b72909a7fcd1c959e36dc784f
static/js/513.c3183f67.chunk.js,1696704887806,3ffbee61e1e12b2ac876d96a8aa82288d705827c4bd232805d09e4d26b19f184
static/media/image-devices.7a9f93355333984b7941.png,1696704887744,db97ae84ccd9a09052017c203e159e7f57d14b473ce5d6095f4b2ff31a047ef8
static/media/bg-header-desktop.3d39ff8e4eec581d1f91.png,1696704887730,6a8849446474587badf86ebf0d58bcf72aef1a680157d90c7cf5b471647da918
static/media/image-computer.65db67db202be4e74616.png,1696704887744,a221118a6e05fc3c24fd4b56839206ab412de9339a853610d20ad142fac73e53
static/js/513.c3183f67.chunk.js.map,1696704887807,0d4d4ba2f497ad3d0cb01e42846812c45900da1978e557b7a5301f8159fb8f5b
static/media/bg-profile.af1219a742e09fc7b612.jpeg,1696704887731,c0224651329e6f23cbe3bd9bfb37986a67de3566a837197af7ba31eb5bf2a928
static/media/house (1).1c4662866d6ca3755cf4.jpg,1696704887731,8610be21401a79ecd5b0448b81190772e7b6e2504a455c9eaf6eb5d2982bb044
static/media/wedding.72b9ec574465c95d19b9.jpg,1696704887744,c45f2c6592cab0cd42dd8d03cab88adaf91ce7aa2ecbf707fa93ca6fa84cfe1f
static/media/newspaper2.d4dec8c732058acfeec1.jpg,1696704887743,3a7a10c19aa48d4ad2c2678da165da3a0d59dd6ef638b2e71cb3af37928b83fa
static/media/background3.3ce0efefbd5f55c07b58.png,1696704887745,4b0f57791be4038375c5d4c7039357793e0c19837615de31b2b8ee60a3aedfc9
static/media/land.545d66910852fb567f29.jpg,1696704887734,b76f1b1f28de91e7e91995c23f05d6dc5d77035402e3f1034be96384f6ec1004
static/js/main.9796e417.js,1696704887807,6a93e135bacf08539a817d5b74177e66d6c95936338bf7941548aa52055bad70
static/media/pattern-tree.431da656681abcdffac51bee04d7f581.svg,1696704887743,077b4cad6cd72eaf768124ce97b66451dabf05a04e422c8cb4452f887b8b8ebb
static/media/background.b28e08e8c97c1c73b13f.jpg,1696704887731,364ba257eb402e2e6a69bfd7544679734f3c62a719f015fa6c499238f87e9b1a
static/media/newspaper1.d9cb92762b7f143bf29b.jpg,1696704887746,dbd7a8fdf1f7f03040c6e6c8dc5d13e3726fc1b243ebeea59e9ceb35e7936e42
static/js/main.9796e417.js.map,1696704887813,16f3e75cd0dcb91e6baf33f7b79310c5a29103b5c624c77a2aa56f4f50fe0992
6 changes: 6 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "advizor-newspaper-ad-analyzer",
"version": "2.2.0",
"private": true,
"proxy": "http://16.170.163.211:5000/",
"author": "Creative Tim",
"license": "See license in https://www.creative-tim.com/license",
"description": "React version of Material Dashboard 2 by Creative Tim",
Expand Down
15 changes: 8 additions & 7 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<link rel="shortcut icon" href="%PUBLIC_URL%/brand-dark.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#1A73E8" />
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<link rel="apple-touch-icon" sizes="76x76" href="%PUBLIC_URL%/brand-dark.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>Advizor- Ad analysis Companion</title>
Expand All @@ -37,17 +38,17 @@
href="https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Two+Tone|Material+Icons+Round|Material+Icons+Sharp"
rel="stylesheet"
/>
<script
defer
data-site="YOUR_DOMAIN_HERE"
src="https://api.nepcha.com/js/nepcha-analytics.js"
></script>
<!-- <script
defer
data-site="newspaper-analyzer.web.app"
src="https://api.nepcha.com/js/nepcha-analytics.js">
</script> -->
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="app"></div>
<script>
<!-- <script>
if ("serviceWorker" in navigator) {
window.addEventListener("load", () => {
navigator.serviceWorker
Expand All @@ -56,6 +57,6 @@
.catch((err) => console.log("Failure: ", err));
});
}
</script>
</script> -->
</body>
</html>
5 changes: 4 additions & 1 deletion src/api/advertisementMap/advertisementLocation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import axios from "axios";
import baseURL from "config";

// Function to fetch data from the backend
export async function getRecentAdLocation(ad_type, duration) {
try {
const response = await axios.get(`/getRecentAdLocation?adtype=${ad_type}&duration=${duration}`); // Adjust the endpoint URL
const response = await axios.get(
`${baseURL}/getRecentAdLocation?adtype=${ad_type}&duration=${duration}`
); // Adjust the endpoint URL
console.log(response.data);
return response.data;
} catch (error) {
Expand Down
5 changes: 3 additions & 2 deletions src/api/advertisemntCards/advertisementCard.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import axios from "axios";
import baseURL from "config";

// Function to fetch data from the backend
export async function getPopularAd() {
try {
const response = await axios.get("/getPopularAd"); // Adjust the endpoint URL
const response = await axios.get(`${baseURL}/getPopularAd`); // Adjust the endpoint URL
console.log(response.data);
return response.data;
} catch (error) {
Expand All @@ -14,7 +15,7 @@ export async function getPopularAd() {

export async function getAdDetail(adID) {
try {
const response = await axios.get(`/getAdDetails?adID=${adID}`);
const response = await axios.get(`${baseURL}/getAdDetails?adID=${adID}`);
console.log(response.data);
return response.data;
} catch (error) {
Expand Down
3 changes: 2 additions & 1 deletion src/api/count/counts.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import axios from "axios";
import baseURL from "config";

// Function to fetch data from the backend
export async function getCounts() {
try {
const response = await axios.get("/getcounts"); // Replace with your API endpoint URL
const response = await axios.get(`${baseURL}/getcounts`); // Replace with your API endpoint URL
return response.data;
} catch (error) {
console.error("Error fetching data from the backend:", error);
Expand Down
2 changes: 1 addition & 1 deletion src/api/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const axios = require("axios");

exports.myFlaskFunction = functions.https.onRequest((request, response) => {
// Define the URL of your local Flask server
const flaskServerURL = "http://127.0.0.1:5000"; // Replace with your Flask server's URL
const flaskServerURL = "http://16.170.163.211:5000/"; // Replace with your Flask server's URL

// Proxy the incoming request to the Flask server
axios({
Expand Down
3 changes: 2 additions & 1 deletion src/api/graphViewer/adDistribution.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import axios from "axios";
import baseURL from "config";

// Function to fetch data from the backend
export async function getAdDistribution() {
try {
const response = await axios.get("/adDistribution"); // Replace with your API endpoint URL
const response = await axios.get(`${baseURL}/adDistribution`); // Replace with your API endpoint URL
return response.data;
} catch (error) {
console.error("Error fetching data from the backend:", error);
Expand Down
3 changes: 2 additions & 1 deletion src/api/graphViewer/catergorizeProposals.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import axios from "axios";
import baseURL from "config";

// Function to fetch data from the backend
export async function getAgeDistribution(criteria) {
try {
const response = await axios.get(`/categorizeby?criteria=${criteria}`);
const response = await axios.get(`${baseURL}/categorizeby?criteria=${criteria}`);
return response.data;
} catch (error) {
console.error("Error fetching data from the backend:", error);
Expand Down
3 changes: 2 additions & 1 deletion src/api/graphViewer/houseSaleAveragePrice.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import axios from "axios";
import baseURL from "config";

// Function to fetch data from the backend
export async function getAverageHousePrice(interval, district) {
try {
const response = await axios.get(
`/getAverageHousePrice?interval=${interval}&district=${district}`
`${baseURL}/getAverageHousePrice?interval=${interval}&district=${district}`
); // Adjust the endpoint URL
return response.data;
} catch (error) {
Expand Down
3 changes: 2 additions & 1 deletion src/api/graphViewer/houseSalebyCity.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import axios from "axios";
import baseURL from "config";

// Function to fetch data from the backend
export async function getHouseSalebyCity() {
try {
const response = await axios.get("/gethouseSalebyCity"); // Replace with your API endpoint URL
const response = await axios.get(`${baseURL}/gethouseSalebyCity`); // Replace with your API endpoint URL
return response.data;
} catch (error) {
console.error("Error fetching data from the backend:", error);
Expand Down
3 changes: 2 additions & 1 deletion src/api/graphViewer/landsaleAveragePrice.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import axios from "axios";
import baseURL from "config";

// Function to fetch data from the backend
export async function getAverageLandPrice(interval, district) {
try {
const response = await axios.get(
`/getAverageLandPrice?interval=${interval}&district=${district}`
`${baseURL}/getAverageLandPrice?interval=${interval}&district=${district}`
); // Adjust the endpoint URL
return response.data;
} catch (error) {
Expand Down
3 changes: 2 additions & 1 deletion src/api/report/getReports.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import axios from "axios";
import baseURL from "config";

// Function to fetch a saved PDF report from the backend
export async function getReportPdf(reportId) {
try {
const response = await axios.get(`/view-pdf?ReportID=${reportId}`, {
const response = await axios.get(`${baseURL}/view-pdf?ReportID=${reportId}`, {
responseType: "blob", // Specify the response type as a blob
});

Expand Down
3 changes: 2 additions & 1 deletion src/api/report/reportsdata.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import axios from "axios";
import baseURL from "config";

// Function to fetch data from the backend
export async function getReportList() {
try {
const response = await axios.get("/get-all-reports"); // Adjust the endpoint URL
const response = await axios.get(`${baseURL}/get-all-reports`); // Adjust the endpoint URL
console.log(response.data);
return response.data;
} catch (error) {
Expand Down
3 changes: 2 additions & 1 deletion src/api/report/saveReport.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";
import baseURL from "config";

// Function to send the PDF URL to the backend
export async function savePdf(pdfURL, userID, title) {
Expand All @@ -8,7 +9,7 @@ export async function savePdf(pdfURL, userID, title) {
formData.append("userID", userID); // Include the userID in the form data
formData.append("title", title);

const response = await axios.post("/upload-pdf-url", formData, {
const response = await axios.post(`${baseURL}/upload-pdf-url`, formData, {
headers: {
"Content-Type": "multipart/form-data",
},
Expand Down
3 changes: 2 additions & 1 deletion src/api/searchBar/getAdbyFilter.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import axios from "axios";
import baseURL from "config";

// Function to fetch data from the backend based on search criteria
export async function getAdbyFilter(selectedOption, searchQuery, startDate, endDate, category) {
try {
const response = await axios.get(
`/filter-ads?selectedOption=${selectedOption}&searchQuery=${searchQuery}&startDate=${startDate}&endDate=${endDate}&category=${category}`
`${baseURL}/filter-ads?selectedOption=${selectedOption}&searchQuery=${searchQuery}&startDate=${startDate}&endDate=${endDate}&category=${category}`
);
console.log(response.data);
return response.data;
Expand Down
3 changes: 2 additions & 1 deletion src/api/searchTable/recentLandSale.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import axios from "axios";
import baseURL from "config";

// Function to fetch data from the backend
export async function getRecentAd(ad_type) {
try {
const response = await axios.get(`/getRecentAd${ad_type}`); // Adjust the endpoint URL
const response = await axios.get(`${baseURL}/getRecentAd${ad_type}`); // Adjust the endpoint URL
console.log(response.data);
return response.data;
} catch (error) {
Expand Down
3 changes: 2 additions & 1 deletion src/api/sendImg.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";
import baseURL from "config";

// Function to upload multiple images to the backend
export async function uploadImages(images) {
Expand All @@ -8,7 +9,7 @@ export async function uploadImages(images) {
});

try {
const response = await axios.post("/upload", formData, {
const response = await axios.post(`${baseURL}/upload`, formData, {
headers: {
"Content-Type": "multipart/form-data",
},
Expand Down
15 changes: 10 additions & 5 deletions src/api/sendPdf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from "axios";
import baseURL from "config";

// Function to upload multiple images to the backend
export async function uploadPdfs(pdfs, isImageContained) {
Expand All @@ -8,11 +9,15 @@ export async function uploadPdfs(pdfs, isImageContained) {
});

try {
const response = await axios.post(`/uploadpdf?isImageContained=${isImageContained}`, formData, {
headers: {
"Content-Type": "multipart/form-data",
},
});
const response = await axios.post(
`${baseURL}/uploadpdf?isImageContained=${isImageContained}`,
formData,
{
headers: {
"Content-Type": "multipart/form-data",
},
}
);
return response.data;
} catch (error) {
console.error("Error sending URL to backend:", error);
Expand Down
Loading

0 comments on commit c141ea4

Please sign in to comment.