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