Compare commits
3 Commits
e7b838e3fe
...
18b2bfdfc4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18b2bfdfc4 | ||
|
|
d12c0797a4 | ||
|
|
d089551d0f |
@@ -8,7 +8,7 @@ import { useCarType } from "@/store/carType";
|
||||
import { usePathname } from "next/navigation";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
const baseUrl = "https://api.spes-texnika.uz/api/v1/subcategory/";
|
||||
const baseUrl = "https://api.spes-texnika.uz/api/v1/subcategory/?category=";
|
||||
|
||||
export default function CartType() {
|
||||
const initialCar = useCarType((state) => state.initialCar);
|
||||
@@ -19,10 +19,10 @@ export default function CartType() {
|
||||
const [cars, setCars] = useState<any[]>([]);
|
||||
|
||||
console.log("car type id: ", initialCar.id);
|
||||
console.log("request URL: ", `${baseUrl}${initialCar.id}/`);
|
||||
console.log("request URL: ", `${baseUrl}${initialCar.id}`);
|
||||
|
||||
useEffect(() => {
|
||||
// Agar ID bo'lmasa, fetchni ishga tushirma
|
||||
// Agar ID bo'lmasa, fetchni ishga tushirma for gitea
|
||||
if (!initialCar.id) {
|
||||
setLoading(false);
|
||||
return;
|
||||
@@ -33,7 +33,7 @@ export default function CartType() {
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
|
||||
const response = await fetch(`${baseUrl}${initialCar.id}/`, {
|
||||
const response = await fetch(`${baseUrl}${initialCar.id}`, {
|
||||
headers: {
|
||||
"Accept-Language": lang,
|
||||
},
|
||||
|
||||
@@ -16,7 +16,7 @@ export default function CarType_Header() {
|
||||
dir="ltr"
|
||||
className="w-full h-[300px] relative flex items-center justify-center max-sm:px-2"
|
||||
>
|
||||
{/* back image */}
|
||||
{/* back image for gitea */}
|
||||
<Image
|
||||
alt="CarTypeImage"
|
||||
src={backOne}
|
||||
|
||||
Reference in New Issue
Block a user