ceo optimization

This commit is contained in:
nabijonovdavronbek619@gmail.com
2026-01-09 17:38:01 +05:00
parent a700fdddc6
commit c2c39d44a0
11 changed files with 117 additions and 50 deletions

14
lib/api.ts Normal file
View File

@@ -0,0 +1,14 @@
import { Product } from "@/lib/products";
export async function getAllProducts(): Promise<Product[]> {
const res = await fetch("https://admin.promtechno.uz/api/products/", {
cache: "force-cache", // build time uchun
});
if (!res.ok) {
console.log("Failed to fetch products");
return [];
}
return res.json();
}