-
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 feature-community
- Loading branch information
Showing
19 changed files
with
220 additions
and
141 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
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
Oops, something went wrong.