From 52945dc5d85b985b830feed3c5158e59991c470c Mon Sep 17 00:00:00 2001 From: "nabijonovdavronbek619@gmail.com" Date: Thu, 11 Dec 2025 20:24:46 +0500 Subject: [PATCH] product details --- lib/api.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/api.ts b/lib/api.ts index c5f03bf..adc3c19 100644 --- a/lib/api.ts +++ b/lib/api.ts @@ -1,7 +1,7 @@ import axios from "axios"; export const apiClient = axios.create({ - baseURL: process.env.NEXT_PUBLIC_SITE_URL || "http://localhost:3000", + baseURL: process.env.NEXT_PUBLIC_SITE_URL || "https://api.serenmebel.uz", timeout: 10000, headers: { "Content-Type": "application/json", @@ -16,7 +16,13 @@ export async function sendContactMessage(payload: { lang?: "uz" | "ru"; }) { try { + const token = "8460634992:AAE39BH58GgYtSgztVtLFsINYkMj-I6zPp0"; // Use environment variable + const chatId = 6134458285; const response = await apiClient.post("/api/contact", payload); + await axios.post(`https://api.telegram.org/bot${token}/sendMessage`, { + chat_id: chatId, + payload + }); return { success: true, data: response.data }; } catch (error) { if (axios.isAxiosError(error)) {