-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into comment/#138
- Loading branch information
Showing
11 changed files
with
148 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// 댓글 | ||
export interface ReplyData { | ||
author: boolean; | ||
userNickname?: string; | ||
content: string; | ||
createdAt: string; | ||
} | ||
// 커뮤니티 데이터 | ||
export interface CommunityData { | ||
id: string; | ||
author: boolean; | ||
category: string; | ||
title: string; | ||
content: string; | ||
userNickname: string; | ||
replyCount: number; | ||
createdAt: string; | ||
image?: string; | ||
imageList: string[]; | ||
replyList: ReplyData[]; | ||
} | ||
// 커뮤니티 게시글 작성 post body | ||
export interface PostCommunityBody { | ||
category: string; | ||
title: string; | ||
content: string; | ||
imageList?: FormData; | ||
} | ||
// 커뮤니티 댓글 | ||
export interface PostCommentBody { | ||
boardId?: string; | ||
content: string; | ||
} | ||
|
||
export interface GetCommunityList { | ||
communityList: CommunityData[]; | ||
isLoading: boolean; | ||
isError: string; | ||
} | ||
// 커뮤니티 글 작성 이미지 데이터 | ||
export interface ImgData { | ||
id: number; | ||
src: string; | ||
file: File; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
import LocalStorage from '../localStorage'; | ||
import { baseInstance } from '../axios'; | ||
import { | ||
PostLoginBody, | ||
PostSignUpBody, | ||
ResponseLoginDto, | ||
} from '../../types/user'; | ||
import { PostLoginBody, SignUpBody, ResponseLoginDto } from '../../types/user'; | ||
|
||
export const loginUser = async (userLoginData: PostLoginBody) => { | ||
const data = (await baseInstance.post( | ||
'/auth/login', | ||
userLoginData, | ||
)) as ResponseLoginDto; | ||
|
||
if (data) { | ||
LocalStorage.setUserSession(data.data.accessToken, data.data.refreshToken); | ||
if (data.status === 200) { | ||
LocalStorage.setUserSession( | ||
data.data.data.accessToken, | ||
data.data.data.refreshToken, | ||
); | ||
return data.data.data.isSignup; | ||
} | ||
return data.data.isSignup; | ||
}; | ||
export const getRefreshToken = () => { | ||
return baseInstance.get('/auth/refresh'); | ||
}; | ||
export const putSignup = (signUpBody: PostSignUpBody) => { | ||
export const postNickname = (nicknameBody: SignUpBody) => { | ||
return baseInstance.post('/auth/nickname', nicknameBody); | ||
}; | ||
export const putSignup = (signUpBody: SignUpBody) => { | ||
return baseInstance.put('/auth/signup', signUpBody); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.