Skip to content

Commit

Permalink
removed null items
Browse files Browse the repository at this point in the history
  • Loading branch information
pirateIV committed Aug 24, 2023
1 parent e0f33a5 commit 4af08ad
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions js/movies.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ async function getMovieDetails(mov_detail_id) {
<section class="casts d-flex gap-5 overflow-scroll overflow-hidden position-relative" style="width: 90vw; height: 50vh">
<div class="d-flex flex-row gap-4 text-center">
${creditData.cast
.filter((cst) => cst.profile_path !== null)
.filter((cst) => cst.profile_path !== null)
.map(
(cst, index) =>
`<div class="cast-img rounded-2">
Expand Down Expand Up @@ -240,15 +240,21 @@ async function getMovieDetails(mov_detail_id) {
<div class="d-flex flex-row gap-4 text-center">
${creditData.crew
.filter((cst) => cst.profile_path !== null)
.map((cst) => `
.map(
(cst) => `
<div class="cast-img rounded-2">
<div>
<img src="${img_path + cst.profile_path}" class="border border-2 border-secondary rounded-2 z-2 position-relative" id="crewImg" width="180" loading="lazy" alt="${cst.original_name}">
<img src="${
img_path + cst.profile_path
}" class="border border-2 border-secondary rounded-2 z-2 position-relative" id="crewImg" width="180" loading="lazy" alt="${
cst.original_name
}">
</div>
<h6 class="text-white">${cst.original_name}</h6>
<small class="opacity-50 d-block">${cst.department}</small>
</div>
`)
`
)
.join(" ")}
</div>
Expand Down

0 comments on commit 4af08ad

Please sign in to comment.