fix: outbound hold count

This commit is contained in:
Yehoshua Sandler 2025-05-04 11:14:14 -05:00
parent 014e3eaa7c
commit 5c328ab0a4
3 changed files with 9 additions and 3 deletions

View File

@ -97,7 +97,13 @@ const UserFeed = async (props: Props) => {
},
})) as PaginatedDocs<Checkout>
const totalHoldNotifications = repos?.docs.flatMap((r) => r.holdRequests?.docs).length || 0
const totalHoldNotifications =
repos?.docs
.flatMap((r) => r.holdRequests?.docs)
.filter((r) => {
const repo = r as HoldRequest
return !repo.isRejected && !repo.isCheckedOut
}).length || 0
const outBoundLoanCount = loanedOutBooks?.totalDocs || 0
const currentlyHoldingCount = currentlyHeldBooks?.totalDocs || 0

View File

@ -161,7 +161,7 @@ const CheckedOutBooks = (props: Props) => {
return (
<section className="py-6">
<div className="mb-4 flex justify-between items-end">
<h3 className="px-4 text-lg font-semibold">Inbound Checked Out Books</h3>
<h3 className="px-4 text-lg font-semibold">Outbound Checked Out Books</h3>
</div>
<CheckedOutBooksList rows={rows} />
</section>

View File

@ -155,7 +155,7 @@ const HoldRequestNotifications = (props: Props) => {
return (
<section className="py-6">
<div className="mb-4 flex justify-between items-end">
<h3 className="px-4 text-lg font-semibold">Inbound Hold Requests</h3>
<h3 className="px-4 text-lg font-semibold">Outbound Hold Requests</h3>
{!!totalHoldNotifications && (
<span className="font-bold">{totalHoldNotifications} Unaddressed</span>
)}