Skip to content

Commit

Permalink
Merge pull request #118 from 100-hours-a-week/feature/lucy
Browse files Browse the repository at this point in the history
Fix : url 바꾼거 다시 원상복귀
  • Loading branch information
lucy726j authored Aug 25, 2024
2 parents 8803ad2 + 3718273 commit 6e43bd8
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 37 deletions.
6 changes: 2 additions & 4 deletions src/Component/List/MyStockItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ const MyStockItem: React.FC<StockProps> = ({
} 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 }
)
Expand Down Expand Up @@ -155,8 +154,7 @@ const MyStockItem: React.FC<StockProps> = ({
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,
}
Expand Down
3 changes: 1 addition & 2 deletions src/Component/Modal/addStock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ const AddOrEditModal: React.FC<AddOrEditModalProps> = ({
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 }
)
Expand Down
10 changes: 3 additions & 7 deletions src/Component/Modal/stockSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,9 @@ const StockSearch: React.FC<StockSearchProps> = ({ 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);
Expand Down
3 changes: 1 addition & 2 deletions src/Component/Portfolio/PfCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
)
Expand Down
16 changes: 6 additions & 10 deletions src/Component/Portfolio/PortfolioDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
19 changes: 7 additions & 12 deletions src/Component/Portfolio/portfolio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6e43bd8

Please sign in to comment.