-
Notifications
You must be signed in to change notification settings - Fork 35
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
[장용한] Sprint11 #317
The head ref may contain hidden characters: "React-\uC7A5\uC6A9\uD55C-sprint11"
[장용한] Sprint11 #317
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import axios from "axios"; | ||
|
||
interface valuetype { | ||
email: string; | ||
nickname?: string; | ||
password: string; | ||
passwordConfirmation?: string; | ||
} | ||
|
||
const apiUrl = process.env.REACT_APP_API_BASE_URL as string; | ||
|
||
export const postAuthSignIn = async (body: valuetype) => { | ||
try { | ||
const res = await axios.post(`${apiUrl}/auth/signIn`, body, { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이런 부분은 |
||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
}); | ||
return res.data; | ||
} catch (error) { | ||
if (axios.isAxiosError(error)) { | ||
console.error("Axios error:", error.response?.data); | ||
} else { | ||
console.error("Unknown error:", error); | ||
} | ||
throw error; | ||
} | ||
}; | ||
|
||
export const postAuthSignUp = async (body: valuetype) => { | ||
try { | ||
const res = await axios.post(`${apiUrl}/auth/signUp`, body, { | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
}); | ||
return res.data; | ||
} catch (error) { | ||
if (axios.isAxiosError(error)) { | ||
console.error("Axios error:", error.response?.data); | ||
} else { | ||
console.error("Unknown error:", error); | ||
} | ||
throw error; | ||
} | ||
}; |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://nextjs.org/docs/pages/building-your-application/routing/pages-and-layouts nextjs layout을 이용해서 조건부 렌더링보다는 nextjs 스러운 방식으로 Header를 구성해보시는게 어떨 까요? |
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.
valueType
보다 어떤value
인지 좀 더 명확하게 해주시면 좋을 것 같아요 !