Skip to content

Commit

Permalink
Merge branch 'develop' into community/#146
Browse files Browse the repository at this point in the history
  • Loading branch information
aeuna authored Jul 22, 2022
2 parents d8044ba + 75ed990 commit 528666b
Show file tree
Hide file tree
Showing 23 changed files with 392 additions and 110 deletions.
2 changes: 1 addition & 1 deletion components/community/ReplyList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export default function ReplyList(props: ReplyListProps) {
boardId: cid,
content: replyText,
});
if (status === 200) router.push(`/community/${cid}`);
setNewReplyInfo({ boardId: cid, content: '' });
if (status === 200) router.push(`/community/${cid}`);
};
const handleCurrentPage = (nextPage: number) => {
setCurrentPage(nextPage);
Expand Down
2 changes: 1 addition & 1 deletion core/api/community.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const getCollectionProduct = (key: string) => {
};

export const getCommunity = () => {
return baseInstance.get(`/board`);
return baseInstance.get('/board');
};

export const postCommunity = (body: FormData) => {
Expand Down
10 changes: 7 additions & 3 deletions core/api/user.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import LocalStorage from '../localStorage';
import { baseInstance } from '../axios';
import { PostLoginBody, SignUpBody, ResponseLoginDto } from '../../types/user';
import {
PostLoginBody,
PostSignUpBody,
ResponseLoginDto,
} from '../../types/user';

export const loginUser = async (userLoginData: PostLoginBody) => {
const data = (await baseInstance.post(
Expand All @@ -19,9 +23,9 @@ export const loginUser = async (userLoginData: PostLoginBody) => {
export const getRefreshToken = () => {
return baseInstance.get('/auth/refresh');
};
export const postNickname = (nicknameBody: SignUpBody) => {
export const postNickname = (nicknameBody: PostSignUpBody) => {
return baseInstance.post('/auth/nickname', nicknameBody);
};
export const putSignup = (signUpBody: SignUpBody) => {
export const putSignup = (signUpBody: PostSignUpBody) => {
return baseInstance.put('/auth/signup', signUpBody);
};
6 changes: 2 additions & 4 deletions core/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ const baseInstance = axios.create({
baseInstance.interceptors.request.use((config) => {
const headers = {
...config.headers,
accessToken:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MzIsImlhdCI6MTY1ODQyOTQxMiwiZXhwIjoxNjU4NDM2NjEyLCJpc3MiOiJub3JpIn0.7lSyNrnwykmuKxnsXmda0-U_RKQxcEUvUBeh2U0FVMM',
refreshToken:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MzIsImlhdCI6MTY1ODM4NDE2OCwiZXhwIjoxNjU5NTkzNzY4LCJpc3MiOiJub3JpIn0.8CHjRIYwHVPHcBktsHx2qmj4M5Z4Y5tPeHOqhLZ_OVs',
accessToken: LocalStorage.getItem('accessToken'),
refreshToken: LocalStorage.getItem('refreshToken'),
};

return { ...config, headers };
Expand Down
Loading

0 comments on commit 528666b

Please sign in to comment.