Skip to content

Commit

Permalink
Fix withdrawal bid button (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
aishaathmanlali authored Aug 10, 2024
1 parent 291ba8b commit 04b6fb9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/src/BidderBiddingList.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,12 @@ const BidderBiddingList = () => {
}
}

await post(`/api/bid/${bidId}/status`, { status: newStatus });
setBids((prevList) =>
prevList.map((bid) =>
bid.bid_id === bidId ? { ...bid, status: newStatus } : bid
)
);

await post(`/api/bid/${bidId}/status`, { status: newStatus });
fetchBids();
} catch (error) {
setErrorMsg("Server Error");
}
Expand Down Expand Up @@ -113,13 +111,15 @@ const BidderBiddingList = () => {
{bid.suggested_duration_days} days
</span>
</p>
{bid.status !== "Withdrawn" && (
{bid.status !== "Withdrawn" ? (
<button
className="btn withdraw-btn"
onClick={() => handleStatusChange(bid.bid_id, "Withdrawn")}
>
Withdraw
</button>
) : (
<p className="withdrawn-text">Withdrawn</p>
)}
</div>
))
Expand Down

0 comments on commit 04b6fb9

Please sign in to comment.