Add movie detail API and enhance draft admin/participant UI
- Introduced `/api/movie/<id>/detail` endpoint returning TMDB data for a movie. - Moved draft detail fetching logic into `common/utils.js` for reuse. - Updated Draft Admin panel: - Added phase navigation buttons with bootstrap icons. - Improved layout with refresh and status controls. - Updated Draft Participant panel: - Added movie pool display with links to movie details. - Added bootstrap-icons stylesheet and corresponding SCSS styles for new UI.
This commit is contained in:
29
frontend/src/apps/draft/common/utils.js
Normal file
29
frontend/src/apps/draft/common/utils.js
Normal file
@@ -0,0 +1,29 @@
|
||||
export async function fetchDraftDetails(draftSessionId) {
|
||||
return fetch(`/api/draft/${draftSessionId}/`)
|
||||
.then((response) => {
|
||||
if (response.ok) {
|
||||
return response.json()
|
||||
}
|
||||
else {
|
||||
throw new Error()
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("Error fetching draft details", err)
|
||||
})
|
||||
}
|
||||
|
||||
export async function fetchMovieDetails(draftSessionId) {
|
||||
return fetch(`/api/draft/${draftSessionId}/movie/`)
|
||||
.then((response) => {
|
||||
if (response.ok) {
|
||||
return response.json()
|
||||
}
|
||||
else {
|
||||
throw new Error()
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("Error fetching draft details", err)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user