From f61a32f48c4ce55903895402d729dc1a4135b9c8 Mon Sep 17 00:00:00 2001 From: Prince86 Date: Tue, 14 Nov 2023 15:41:21 +0530 Subject: [PATCH] fix: url generation --- src/app/api/chatmodel/[chatid]/route.ts | 3 ++- src/app/api/generateTitle/[chatid]/[orgid]/route.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/api/chatmodel/[chatid]/route.ts b/src/app/api/chatmodel/[chatid]/route.ts index 4d77ed50..190a6e52 100644 --- a/src/app/api/chatmodel/[chatid]/route.ts +++ b/src/app/api/chatmodel/[chatid]/route.ts @@ -79,7 +79,8 @@ export async function POST( console.log("got in 1 length case"); _chat.push(latestReponse); fetch( - `zeplo.to/${urlArray[2]}/api/generateTitle/${id}/${orgId}?_token=${env.ZEPLO_TOKEN}`, + `https://zeplo.to/https://${urlArray[2]}/api/generateTitle/${id}/${orgId}?_token=${env.ZEPLO_TOKEN}`, + // `https://zeplo.to/https://echoes-ksyl6ee7h-tcr.vercel.app/api/generateTitle/1318/org_2SaqWIpmGf4bkmTGoFpc6kk1RDx?_token=ihaLqOwKwvWqtYaMPqHR8QGko3a2lstVqJuYXg`, { method: "POST", body: JSON.stringify({ chat: _chat }), diff --git a/src/app/api/generateTitle/[chatid]/[orgid]/route.ts b/src/app/api/generateTitle/[chatid]/[orgid]/route.ts index 9e4c770e..22a2a0e8 100644 --- a/src/app/api/generateTitle/[chatid]/[orgid]/route.ts +++ b/src/app/api/generateTitle/[chatid]/[orgid]/route.ts @@ -21,7 +21,7 @@ export async function POST( const mainUrl = urlArray.slice(0, 3).join("/"); const fullResponse = await generateTitle(messages); fetch( - `zeplo.to/${urlArray[2]}/api/generateImage/${chatId}/${orgId}?_token=${env.ZEPLO_TOKEN}`, + `https://zeplo.to/https://${urlArray[2]}/api/generateImage/${chatId}/${orgId}?_token=${env.ZEPLO_TOKEN}`, { method: "POST", body: JSON.stringify({ chatTitle: fullResponse }),