-
Notifications
You must be signed in to change notification settings - Fork 5
Feat: API route 파일들 추가 #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
💄 Storybook: https://673dcf13c9a3a1189a7c6fd4-wjyqnwkclj.chromatic.com/ # Chromatic에서 생성된 Storybook URL |
hongggyelim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다 ! oauth 토큰 부분만 다시한번 확인해주세욥 👍
imtaejunk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!
| if (!["google", "kakao"].includes(provider)) { | ||
| return NextResponse.json({ message: "Invalid provider" }, { status: 400 }); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
소셜 로그인 대비로 미리 잡아두셨군요 !
| @@ -0,0 +1,44 @@ | |||
| import { AxiosError } from "axios"; | |||
| import { cookies } from "next/headers"; | |||
| import { NextResponse } from "next/server"; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next/server !
| return NextResponse.json(response.data); | ||
| } catch (error: unknown) { | ||
| if (error instanceof AxiosError) { | ||
| console.error("GET /api/users/me/posts error:", error); | ||
| if (error.response) { | ||
| return NextResponse.json({ message: error.response.data.message }, { status: error.response.status }); | ||
| } | ||
| } | ||
| return NextResponse.json({ message: "Internal Server Error" }, { status: 500 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이전에 next/server를 사용하지 않았어서 헷갈리는데
import axiosInstance from "./axiosInstanceApi";
import axios from "axios";
로 api를 통신하는 방법과 어떤차이가 있나요 ??
No description provided.