55 |
56 | setBid({ ...bid, bidder: e.target.value })}
62 | placeholder="Bidder"
63 | >
64 |
65 |
66 |
72 | setBid({ ...bid, amount: parseInt(e.target.value) })
73 | }
74 | placeholder="Amount"
75 | >
76 |
77 |
78 |
84 |
85 |
86 | >
87 | );
88 | };
89 |
90 | export default Bids;
91 |
--------------------------------------------------------------------------------
/ReactWeb/src/config.ts:
--------------------------------------------------------------------------------
1 | const config = {
2 | baseApiUrl: "https://localhost:4000",
3 | };
4 |
5 | const currencyFormatter = Intl.NumberFormat("en-US", {
6 | style: "currency",
7 | currency: "USD",
8 | maximumFractionDigits: 0,
9 | });
10 |
11 | export default config;
12 | export { currencyFormatter };
13 |
--------------------------------------------------------------------------------
/ReactWeb/src/hooks/BidHooks.ts:
--------------------------------------------------------------------------------
1 | import { Bid } from "./../types/bid";
2 | import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
3 | import Config from "../config";
4 | import axios, { AxiosError, AxiosResponse } from "axios";
5 | import Problem from "../types/problem";
6 |
7 | const useFetchBids = (houseId: number) => {
8 | return useQuery