Add confirm
This commit is contained in:
parent
ee31b639b2
commit
efd0dab792
|
|
@ -10,11 +10,15 @@ import { useRouter, useSearchParams } from "next/navigation";
|
||||||
import useApiClient from "@/hooks/useApiClient";
|
import useApiClient from "@/hooks/useApiClient";
|
||||||
import { getImageUrl, formatPrice, calculateTotalPrice } from "@/lib/utils";
|
import { getImageUrl, formatPrice, calculateTotalPrice } from "@/lib/utils";
|
||||||
import { parseISO } from "date-fns";
|
import { parseISO } from "date-fns";
|
||||||
|
import useAuthStore from "@/stores/useAuthStore";
|
||||||
import { CatalogItemLongDto } from "@/api/types";
|
import { CatalogItemLongDto } from "@/api/types";
|
||||||
|
|
||||||
function ConfirmPageContent() {
|
function ConfirmPageContent() {
|
||||||
const [yacht, setYacht] = useState<CatalogItemLongDto | null>(null);
|
const [yacht, setYacht] = useState<CatalogItemLongDto | null>(null);
|
||||||
|
|
||||||
|
const { getUserId } = useAuthStore();
|
||||||
|
|
||||||
|
const userId = getUserId();
|
||||||
const client = useApiClient();
|
const client = useApiClient();
|
||||||
const [promocode, setPromocode] = useState("");
|
const [promocode, setPromocode] = useState("");
|
||||||
const [isPromocodeApplied, setIsPromocodeApplied] = useState(false);
|
const [isPromocodeApplied, setIsPromocodeApplied] = useState(false);
|
||||||
|
|
@ -181,7 +185,7 @@ function ConfirmPageContent() {
|
||||||
startUtc,
|
startUtc,
|
||||||
endUtc,
|
endUtc,
|
||||||
yachtId: Number(yachtId),
|
yachtId: Number(yachtId),
|
||||||
reservatorId: Number("userId"), // TODO
|
reservatorId: Number(userId),
|
||||||
};
|
};
|
||||||
|
|
||||||
await client.post("/reservations", body);
|
await client.post("/reservations", body);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue