File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ import clsx from 'clsx'
2323const checkIsDue = ( borrow : Borrow ) => {
2424 const now = new Date ( )
2525 const due = new Date ( borrow . due_at )
26- return now > due
26+ return now > due && ! borrow . returning
2727}
2828
2929const getBorrowStatus = ( borrow : Borrow ) => {
@@ -39,7 +39,7 @@ export const CardBorrow: React.FC<{ borrow: Borrow }> = ({ borrow }) => {
3939 < Card
4040 key = { borrow . id }
4141 className = { clsx ( 'relative' , {
42- 'bg-destructive/5' : isDue && ! borrow . returning ?. returned_at ,
42+ 'bg-destructive/5' : isDue ,
4343 } ) }
4444 >
4545 < CardHeader >
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ export const returnBorrow = async (
6868) : GetBorrowResponse => {
6969 const response = await fetch ( `${ BORROW_URL } /${ data . id } /return` , {
7070 ...init ,
71- method : 'PUT ' ,
71+ method : 'POST ' ,
7272 body : JSON . stringify ( data ) ,
7373 headers : {
7474 'Content-Type' : 'application/json' ,
You can’t perform that action at this time.
0 commit comments