Skip to content

Commit

Permalink
[refactor] apis 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
candosh committed Jul 3, 2024
1 parent 93bb2d6 commit d634fa2
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/pages/main/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { authState } from "../../atoms/authState";
import { useRecoilState } from "recoil";
import LeftButton from "../../assets/LeftButton.svg";
import RightButton from "../../assets/RightButton.svg";
import axiosInstance from "../../apis/axiosConfig";

type MentorCategory = {
기획: "PM";
Expand Down Expand Up @@ -77,16 +76,18 @@ function Main() {
}, [auth.token]);

const getMentorData = () => {
const url = `/api/v1/mentor/${mentorCategory[activeButtons]}`;

axiosInstance
.get(url, {
headers: {
Authorization: `Bearer ${auth.token}`,
},
})
.then((response) => {
setMentorData(response.data);
const url = `https://cogo.life/api/v1/mentor/${mentorCategory[activeButtons]}`;

fetch(url, {
method: "GET",
headers: {
Authorization: `Bearer ${auth.token}`,
"Content-Type": "application/json",
},
})
.then((response) => response.json())
.then((data) => {
setMentorData(data);
})
.catch((error) => {
console.error("Error:", error);
Expand Down

0 comments on commit d634fa2

Please sign in to comment.