From 37182735f042b6367af731c1801bf1c15112f5ef Mon Sep 17 00:00:00 2001 From: lucy726j Date: Mon, 26 Aug 2024 01:09:36 +0900 Subject: [PATCH] =?UTF-8?q?Fix=20:=20url=20=EB=B0=94=EA=BE=BC=EA=B1=B0=20?= =?UTF-8?q?=EB=8B=A4=EC=8B=9C=20=EC=9B=90=EC=83=81=EB=B3=B5=EA=B7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Component/List/MyStockItem.tsx | 6 ++---- src/Component/Modal/addStock.tsx | 3 +-- src/Component/Modal/stockSearch.tsx | 10 +++------- src/Component/Portfolio/PfCreate.tsx | 3 +-- src/Component/Portfolio/PortfolioDetail.tsx | 16 ++++++---------- src/Component/Portfolio/portfolio.tsx | 19 +++++++------------ 6 files changed, 20 insertions(+), 37 deletions(-) diff --git a/src/Component/List/MyStockItem.tsx b/src/Component/List/MyStockItem.tsx index 0dcc194..a3b318d 100644 --- a/src/Component/List/MyStockItem.tsx +++ b/src/Component/List/MyStockItem.tsx @@ -91,8 +91,7 @@ const MyStockItem: React.FC = ({ } else if (modalAction === "edit") { axios .put( - // `${process.env.REACT_APP_API_URL}/v1/portfolio/${portfolioId}/holding/${code}`, - `http://localhost:8080/v1/portfolio/${portfolioId}/holding/${code}`, + `${process.env.REACT_APP_API_URL}/v1/portfolio/${portfolioId}/holding/${code}`, { quantity: newQuantity, price: newPrice }, { withCredentials: true } ) @@ -155,8 +154,7 @@ const MyStockItem: React.FC = ({ const deleteHandle = () => { axios .delete( - // `${process.env.REACT_APP_API_URL}/v1/portfolio/${portfolioId}/holding/${code}`, - `http://localhost:8080/v1/portfolio/${portfolioId}/holding/${code}`, + `${process.env.REACT_APP_API_URL}/v1/portfolio/${portfolioId}/holding/${code}`, { withCredentials: true, } diff --git a/src/Component/Modal/addStock.tsx b/src/Component/Modal/addStock.tsx index 0fc31a4..0f09978 100644 --- a/src/Component/Modal/addStock.tsx +++ b/src/Component/Modal/addStock.tsx @@ -64,8 +64,7 @@ const AddOrEditModal: React.FC = ({ if (selectedStock && quantity > 0 && price > 0) { axios .post( - // `${process.env.REACT_APP_API_URL}/v1/portfolio/${id}/holding/${selectedStock.code}`, - `http://localhost:8080/v1/portfolio/${id}/holding/${selectedStock.code}`, + `${process.env.REACT_APP_API_URL}/v1/portfolio/${id}/holding/${selectedStock.code}`, { quantity, price }, { withCredentials: true } ) diff --git a/src/Component/Modal/stockSearch.tsx b/src/Component/Modal/stockSearch.tsx index d627b12..9bb4aa5 100644 --- a/src/Component/Modal/stockSearch.tsx +++ b/src/Component/Modal/stockSearch.tsx @@ -47,13 +47,9 @@ const StockSearch: React.FC = ({ onSelect, onClose }) => { useEffect(() => { axios - .get( - // `${process.env.REACT_APP_API_URL}/v1/stocks?order=capital`, - `http://localhost:8080/v1/stocks?order=capital`, - { - withCredentials: true, - } - ) + .get(`${process.env.REACT_APP_API_URL}/v1/stocks?order=capital`, { + withCredentials: true, + }) .then((res) => { console.log(res.data.stock); setStockList(res.data.stock); diff --git a/src/Component/Portfolio/PfCreate.tsx b/src/Component/Portfolio/PfCreate.tsx index 820fcf1..b4c10b4 100644 --- a/src/Component/Portfolio/PfCreate.tsx +++ b/src/Component/Portfolio/PfCreate.tsx @@ -61,8 +61,7 @@ const PfCreate: React.FC = () => { console.log("handleConfirm called. create : ", portfolioName); axios .post( - // `${process.env.REACT_APP_API_URL}/v1/portfolio`, - `http://localhost:8080/v1/portfolio`, + `${process.env.REACT_APP_API_URL}/v1/portfolio`, { name: portfolioName }, { withCredentials: true } ) diff --git a/src/Component/Portfolio/PortfolioDetail.tsx b/src/Component/Portfolio/PortfolioDetail.tsx index a757f48..9bc68b7 100644 --- a/src/Component/Portfolio/PortfolioDetail.tsx +++ b/src/Component/Portfolio/PortfolioDetail.tsx @@ -25,16 +25,12 @@ const PortfolioDetail = () => { // 포트폴리오 상세 조회 useEffect(() => { axios - .get( - // `${process.env.REACT_APP_API_URL}/v1/portfolio/${id}`, - `http://localhost:8080/v1/portfolio/${id}`, - { - withCredentials: true, - headers: { - "Content-Type": "application/json", - }, - } - ) + .get(`${process.env.REACT_APP_API_URL}/v1/portfolio/${id}`, { + withCredentials: true, + headers: { + "Content-Type": "application/json", + }, + }) .then((res) => { if (res.status === 200) { // console.log("개별 포트폴리오 조회", res); diff --git a/src/Component/Portfolio/portfolio.tsx b/src/Component/Portfolio/portfolio.tsx index 999b380..a5840c6 100644 --- a/src/Component/Portfolio/portfolio.tsx +++ b/src/Component/Portfolio/portfolio.tsx @@ -47,8 +47,7 @@ const Portfolio = () => { console.log("handleConfirm called", portfolioName); axios .post( - // `${process.env.REACT_APP_API_URL}/v1/portfolio`, - `http://localhost:8080/v1/portfolio`, + `${process.env.REACT_APP_API_URL}/v1/portfolio`, { name: portfolioName }, { withCredentials: true } ) @@ -82,16 +81,12 @@ const Portfolio = () => { // 포트폴리오 전체 조회 useEffect(() => { axios - .get( - // `${process.env.REACT_APP_API_URL}/v1/portfolio`, - `http://localhost:8080/v1/portfolio`, - { - withCredentials: true, - headers: { - "Content-Type": "application/json", - }, - } - ) + .get(`${process.env.REACT_APP_API_URL}/v1/portfolio`, { + withCredentials: true, + headers: { + "Content-Type": "application/json", + }, + }) .then((res) => { if (res.status === 200) { setTotalAsset(res.data.budget);