diff --git a/src/apis/interview/api.ts b/src/apis/interview/api.ts new file mode 100644 index 0000000..4ee9167 --- /dev/null +++ b/src/apis/interview/api.ts @@ -0,0 +1,15 @@ +import axios from "axios"; + +export const getInterviewApi = async (name: string) => { + return await axios + .get(`${process.env.NEXT_PUBLIC_SERVER_URL}/api/interviews?part=${name}`) + .then((response) => { + return response; + }) + .catch((error) => { + if (axios.isAxiosError(error)) { + const result = error.response?.data?.detail; + return result; + } + }); +}; diff --git a/src/components/interview/InterviewCard.tsx b/src/components/interview/InterviewCard.tsx index 33f1d0c..a41b964 100644 --- a/src/components/interview/InterviewCard.tsx +++ b/src/components/interview/InterviewCard.tsx @@ -1,4 +1,3 @@ -import { InterviewCardProp } from "@/store/testData"; import Image from "next/image"; import React from "react"; import { styled } from "twin.macro"; diff --git a/src/components/interview/InterviewCardWrapper.tsx b/src/components/interview/InterviewCardWrapper.tsx index 44bf8d3..af33fa4 100644 --- a/src/components/interview/InterviewCardWrapper.tsx +++ b/src/components/interview/InterviewCardWrapper.tsx @@ -2,8 +2,8 @@ import React, { useEffect, useState } from "react"; import { css, styled } from "twin.macro"; import Arrowdown from "@/svg/arrowdown.svg"; import { TotalInterviewInfo } from "@/store/type"; -import axios from "axios"; import CallInterviewCard from "./CallInterviewCard"; +import { getInterviewApi } from "@/apis/interview/api"; const InterviewCardWrapper = () => { const options = [ @@ -95,20 +95,6 @@ const InterviewCardWrapper = () => { export default InterviewCardWrapper; -export const getInterviewApi = async (name: string) => { - return await axios - .get(`${process.env.NEXT_PUBLIC_SERVER_URL}/api/interviews?part=${name}`) - .then((response) => { - return response; - }) - .catch((error) => { - if (axios.isAxiosError(error)) { - const result = error.response?.data?.detail; - return result; - } - }); -}; - const InterviewButton = styled.button(({ select }: { select: boolean }) => [ css` width: 140px; diff --git a/src/components/interview/QNABox.tsx b/src/components/interview/QNABox.tsx index 53be04a..6e23b2b 100644 --- a/src/components/interview/QNABox.tsx +++ b/src/components/interview/QNABox.tsx @@ -9,7 +9,6 @@ type Props = { }; const QNABox = (props: Props) => { - //이부분은 나중에 바뀔 것..! 서버에서 받은걸로 하나하나 돌릴것이기 때문! return ( <> {props.interviewAnswers.map((e, i) => ( diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 33a3d04..b64184d 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,5 +1,4 @@ import Footer from "@/components/utils/Footer"; -import Nav from "@/components/utils/Nav"; import "@/styles/globals.css"; import type { AppProps } from "next/app"; import dynamic from "next/dynamic"; diff --git a/src/pages/auth/index.tsx b/src/pages/auth/index.tsx index a851e31..3799c62 100644 --- a/src/pages/auth/index.tsx +++ b/src/pages/auth/index.tsx @@ -1,5 +1,4 @@ import { userInfoState } from "@/store/atoms"; -import { useSearchParams } from "next/navigation"; import { useRouter } from "next/router"; import React, { useEffect } from "react"; import { useSetRecoilState } from "recoil"; diff --git a/src/store/testData.tsx b/src/store/testData.tsx deleted file mode 100644 index e94c363..0000000 --- a/src/store/testData.tsx +++ /dev/null @@ -1,120 +0,0 @@ -export interface InterviewCardProp { - name: string; - part: string; - img: string; -} - -export interface InterviewRouteProp extends InterviewCardProp { - index: number; -} - -export const InterviewCardTest = [ - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 1, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 2, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 3, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 4, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 5, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 6, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 7, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 8, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 9, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 10, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 11, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 20, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 21, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 22, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 23, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 24, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 25, - }, - { - name: "11기 노지우", - part: "디자인", - img: "https://cms-cdn.placeholder.co/Vancouver_87c09f1b29.png?width=750", - index: 26, - }, -];