Skip to content

Commit

Permalink
Merge pull request #78 from CapstoneDesign24-GQ/hyunah7
Browse files Browse the repository at this point in the history
fix: getStateInfo.js 수정
  • Loading branch information
wiseah authored Jun 9, 2024
2 parents 03d0525 + b0b0954 commit 5e35074
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 5e35074

Please sign in to comment.