Skip to content

Commit

Permalink
Update: api요청 전역에서 관리하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
extinctmule committed Sep 10, 2024
1 parent 5256162 commit a168a35
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/components/CandleStickChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Tooltip,
} from 'chart.js';
import { Bar } from 'react-chartjs-2';
import axiosClient from '../axiosConfig';
import apiClient from '../axiosConfig';
import { ButtonGroupItem } from './Common';

ChartJS.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend);
Expand All @@ -30,15 +30,12 @@ const CandlestickChart = ({ productNumber }) => {
// API 호출 함수
const fetchStockData = async () => {
try {
const response = await axiosClient.get(
'https://api.ant-helper.com/api/stocks/price-chart',
{
params: {
productNumber: productNumber,
periodCode: periodCode,
},
const response = await apiClient.get('/api/stocks/price-chart', {
params: {
productNumber: productNumber,
periodCode: periodCode,
},
);
});

if (response.data.isSuccess) {
let stockData = response.data.data.output2;
Expand Down

0 comments on commit a168a35

Please sign in to comment.