fix: outbound hold count
This commit is contained in:
parent
014e3eaa7c
commit
5c328ab0a4
@ -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
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user