Skip to content

Commit

Permalink
fix: getStateInfo.js 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
wiseah committed Jun 9, 2024
1 parent d5bcafb commit b0b0954
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions src/APIs/get/getStateInfo.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
import axiosInstance from "../axiosinstance";

async function getStateInfo(){
try{
const response = await axiosInstance.get(
`/weather/api/get/maininfo/`,{}
)
return response.data;
} catch (error) {
console.log('오류 발생', error);
}
}
export default getStateInfo;
// import axiosInstance from "../axiosinstance";

// async function getStateInfo(){
// try{
// const response = await axiosInstance.get(
// `/weather/api/get/maininfo/`,{}
// )
// return response.data;
// } catch (error) {
// console.log('오류 발생', error);
// }
// }
// export default getStateInfo;

import axios from 'axios';

const getStateInfo = async () => {
try {
const response = await axios.get('/api/weather/api/get/maininfo/');
return response.data;
} catch (error) {
throw new Error('Error fetching state info:', error);
}
};

export default getStateInfo;

0 comments on commit b0b0954

Please sign in to comment.