-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bug: Content.header section margin -> 0 * cors 테스트 * Style: 콤마찍는거 제거 * feat: content api 구현 * feat: contentPage에서 fetch후 컴포넌트에 props로 주입 * feat: Contet.Header 데이터 * feat: Content.Cast 데이터 props로 주입 * feat: Content.panel 데이터 props로 주입 및 MyCommentBox 컴포넌트 분리 * feat: MyCommentBox 컴포넌트 구현 * feat: 모달 컴포넌트 구현 * feat: 코멘트, 대댓글 작성 모달 구현 * feat: Content.Comment 데이터 props로 주입 * feat: 코멘트 api구현 * feat: 평점 매기기 api연결 * feat: 코멘트 리스트 페이지 데이터 fetch 구현 * feat : 별점 api 서비스 구현 * feat : 코멘트 작성/수정/삭제 기능 추가 * feat : user subpage의 유저가 평가한 영화 리스트 데이터 패칭 추가 --------- Co-authored-by: suhyeonOh <[email protected]>
- Loading branch information
1 parent
ba82d1c
commit dca2178
Showing
27 changed files
with
1,366 additions
and
504 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 |
---|---|---|
|
@@ -3,6 +3,5 @@ | |
"semi": true, | ||
"useTabs": false, | ||
"tabWidth": 2, | ||
"trailingComma": "all", | ||
"printWidth": 80 | ||
} |
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import { BASE_API_URL } from "./const"; | ||
|
||
// 아직 영화리스트가 없어서 받아보기 어려움 | ||
// type은 추후에 enum으로 수정 | ||
export async function getCommentListRequest(movieCD: string) { | ||
return fetch(`${BASE_API_URL}/contents/${movieCD}/comments`, { | ||
method: "GET", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
}); | ||
} | ||
|
||
export async function createCommentRequest( | ||
movieCD: string, | ||
accessToken: string, | ||
content: string, | ||
has_spoiler: boolean | ||
) { | ||
return fetch(`${BASE_API_URL}/contents/${movieCD}/comments/`, { | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
Authorization: "Bearer " + accessToken, | ||
}, | ||
body: JSON.stringify({ | ||
content, | ||
has_spoiler: has_spoiler, | ||
}), | ||
}); | ||
} | ||
|
||
//특정 코멘트 아이디의 코멘트를 알 수 있다. | ||
export async function getCommentRequest(commentId: number) { | ||
return fetch(`${BASE_API_URL}/comments/${commentId}`, { | ||
method: "GET", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
credentials: "include", | ||
}); | ||
} | ||
|
||
export async function updateCommentRequest( | ||
commentId: number, | ||
accessToken: string, | ||
content: string, | ||
hasSpoiler: boolean | ||
) { | ||
return fetch(`${BASE_API_URL}/comments/${commentId}`, { | ||
method: "PUT", | ||
headers: { | ||
"Content-Type": "application/json", | ||
Authorization: "Bearer " + accessToken, | ||
}, | ||
credentials: "include", | ||
body: JSON.stringify({ | ||
content, | ||
has_spoiler: hasSpoiler, | ||
}), | ||
}); | ||
} | ||
|
||
export async function deleteCommentRequest(id: number, accessToken: string) { | ||
return fetch(`${BASE_API_URL}/comments/${id}`, { | ||
method: "DELETE", | ||
headers: { | ||
"Content-Type": "application/json", | ||
Authorization: "Bearer " + accessToken, | ||
}, | ||
credentials: "include", | ||
}); | ||
} | ||
|
||
export async function getCommentReplies(commentId: number) { | ||
return fetch(`${BASE_API_URL}/comments/${commentId}/replies`, { | ||
method: "GET", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
credentials: "include", | ||
}); | ||
} |
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,76 @@ | ||
import { BASE_API_URL } from "./const"; | ||
|
||
// 아직 영화리스트가 없어서 받아보기 어려움 | ||
// type은 추후에 enum으로 수정 | ||
export async function getContentListRequest(order: string) { | ||
return fetch(`${BASE_API_URL}/contents?order=${order}`, { | ||
method: "GET", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
credentials: "include", | ||
}); | ||
} | ||
|
||
export async function getContentRequest(movieCD: string, accessToken?: string) { | ||
const headers: HeadersInit = accessToken | ||
? { | ||
"Content-Type": "application/json", | ||
Authorization: "Bearer " + accessToken, | ||
} | ||
: { | ||
"Content-Type": "application/json", | ||
}; | ||
return fetch(`${BASE_API_URL}/contents/${movieCD}`, { | ||
method: "GET", | ||
headers, | ||
// credentials: "include", | ||
}); | ||
} | ||
|
||
export async function createRatingRequest( | ||
movieCD: string, | ||
rate: number, | ||
accessToken: string | ||
) { | ||
return fetch(`${BASE_API_URL}/contents/${movieCD}/rate`, { | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
Authorization: "Bearer " + accessToken, | ||
}, | ||
credentials: "include", | ||
body: JSON.stringify({ | ||
rate, | ||
}), | ||
}); | ||
} | ||
|
||
export async function updateRatingRequest( | ||
rateId: number, | ||
rate: number, | ||
accessToken: string | ||
) { | ||
return fetch(`${BASE_API_URL}/contents/rates/${rateId}`, { | ||
method: "PUT", | ||
headers: { | ||
"Content-Type": "application/json", | ||
Authorization: "Bearer " + accessToken, | ||
}, | ||
credentials: "include", | ||
body: JSON.stringify({ | ||
rate, | ||
}), | ||
}); | ||
} | ||
|
||
export async function deleteRatingRequest(rateId: number, accessToken: string) { | ||
return fetch(`${BASE_API_URL}/contents/rates/${rateId}`, { | ||
method: "DELETE", | ||
headers: { | ||
"Content-Type": "application/json", | ||
Authorization: "Bearer " + accessToken, | ||
}, | ||
credentials: "include", | ||
}); | ||
} |
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.