style: clean up code formatting and remove trailing whitespace
refactor: reorganize imports and fix type imports
This commit is contained in:
1 parent
d3704602fd
commit
47c04de6fe
232 files changed
+7140
-4798
No files matched your search
@@ -32,7 +32,7 @@ export async function createBid(data: CreateBidData): Promise<Bid> {
|
||||
VALUES ($1, $2, $3, $4)
|
||||
RETURNING *
|
||||
`,
|
||||
[data.listing_id, data.bidder_id, data.bid_amount, data.bid_type || null]
|
||||
[data.listing_id, data.bidder_id, data.bid_amount, data.bid_type || null],
|
||||
);
|
||||
|
||||
return result.rows[0];
|
||||
@@ -43,7 +43,7 @@ export async function createBid(data: CreateBidData): Promise<Bid> {
|
||||
*/
|
||||
export async function getBidsByListing(
|
||||
listingId: number,
|
||||
activeOnly: boolean = true
|
||||
activeOnly: boolean = true,
|
||||
): Promise<Bid[]> {
|
||||
let sql = `
|
||||
SELECT * FROM bids
|
||||
@@ -73,7 +73,7 @@ export async function getHighestBid(listingId: number): Promise<Bid | null> {
|
||||
ORDER BY bid_amount DESC, created_at DESC
|
||||
LIMIT 1
|
||||
`,
|
||||
[listingId]
|
||||
[listingId],
|
||||
);
|
||||
|
||||
return result.rows[0] || null;
|
||||
@@ -89,7 +89,7 @@ export async function cancelBid(bidId: number): Promise<boolean> {
|
||||
SET is_active = FALSE
|
||||
WHERE bid_id = $1
|
||||
`,
|
||||
[bidId]
|
||||
[bidId],
|
||||
);
|
||||
|
||||
return (result.rowCount ?? 0) > 0;
|
||||
@@ -103,9 +103,8 @@ export async function getBidById(bidId: number): Promise<Bid | null> {
|
||||
`
|
||||
SELECT * FROM bids WHERE bid_id = $1
|
||||
`,
|
||||
[bidId]
|
||||
[bidId],
|
||||
);
|
||||
|
||||
return result.rows[0] || null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user