INNER CODE UNIT · JavaScript
isRejected
Dsadd4/AgentFigureGallery · frontend/reference_gallery/app.js:107
const isRejected = (item) => item.status === "rejected" || item.global_status === "global_rejected";
return {
all: candidates.length,
candidate: candidates.filter((item) => item.status === "candidate" && item.global_status !== "global_rejected").length,
liked: candidates.filter(isTypeLiked).length,
selected: candidates.filter((item) => item.status === "selected").length,
rejected: candidates.filter(isRejected).length,
globalLiked: candidates.filter((item) => item.global_status === "global_liked").length,
globalRejected: candidates.filter((item) => item.global_status === "global_rejected").length,
};
}
function updateCounts() {
const counts = statusCounts();
el.countAll.textContent = counts.all;
el.countCandidate.textContent = counts.candidate;
el.countLiked.textContent = counts.liked;
el.countGlobalLiked.textContent = counts.globalLiked;