From 1299fc4dd32622eb71e7748d7d1916b81e00fc00 Mon Sep 17 00:00:00 2001 From: mifi Date: Sat, 7 Feb 2026 17:27:36 -0300 Subject: [PATCH] Fixes for API logo issues --- qr-api/src/shorten.ts | 11 ++++++++++- qr-web/src/components/Editor.tsx | 14 +------------- qr-web/src/lib/qrStylingOptions.ts | 2 +- qr-web/src/types/project.ts | 2 +- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/qr-api/src/shorten.ts b/qr-api/src/shorten.ts index 5df5bb3..4ccf912 100644 --- a/qr-api/src/shorten.ts +++ b/qr-api/src/shorten.ts @@ -18,14 +18,23 @@ export async function shortenUrl( } const base = env.KUTT_BASE_URL.replace(/\/$/, ''); + const apiKey = env.KUTT_API_KEY.trim(); + + // Extract domain from SHORT_DOMAIN (e.g., "https://mifi.me" -> "mifi.me") + const domain = env.SHORT_DOMAIN.replace(/^https?:\/\//, '').replace( + /\/$/, + '', + ); + const res = await fetch(`${base}/api/v2/links`, { method: 'POST', headers: { 'Content-Type': 'application/json', - 'X-API-Key': env.KUTT_API_KEY, + 'X-API-Key': apiKey, }, body: JSON.stringify({ target: body.targetUrl, + domain: domain, ...(body.customSlug && { customurl: body.customSlug }), }), }); diff --git a/qr-web/src/components/Editor.tsx b/qr-web/src/components/Editor.tsx index 5dd731b..6501cbc 100644 --- a/qr-web/src/components/Editor.tsx +++ b/qr-web/src/components/Editor.tsx @@ -1020,19 +1020,7 @@ export function Editor({ id }: EditorProps) { updateProject({ recipeJson: JSON.stringify(r) }); }} /> -