From 41e333b30e8d31192f0548dfd6b8563458fff71f Mon Sep 17 00:00:00 2001 From: Mohan Ki Date: Mon, 27 Jul 2026 18:47:54 +0530 Subject: [PATCH] fix: Fix syntax errors introduced by shell interpolation in dashboard and edit pages --- client/src/app/dashboard/edit/[id]/page.tsx | 14 ++++---- client/src/app/dashboard/page.tsx | 36 ++++++++++++--------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/client/src/app/dashboard/edit/[id]/page.tsx b/client/src/app/dashboard/edit/[id]/page.tsx index a632984..00e5549 100644 --- a/client/src/app/dashboard/edit/[id]/page.tsx +++ b/client/src/app/dashboard/edit/[id]/page.tsx @@ -26,7 +26,7 @@ export default function EditQRPage() { width: 300, height: 300, type: 'svg', - data: $baseUrl/l/preview, + data: `${baseUrl}/l/preview`, margin: 10, qrOptions: { typeNumber: 0, mode: 'Byte', errorCorrectionLevel: 'Q' }, imageOptions: { hideBackgroundDots: true, imageSize: 0.4, margin: 5 }, @@ -44,7 +44,7 @@ export default function EditQRPage() { }).catch(() => {}); // Fetch existing QR Data - api.get(/qr/ + qrId).then(res => { + api.get(`/qr/${qrId}`).then(res => { const qr = res.data.qr_code; setQrName(qr.name); setDestinationUrl(qr.destination_url); @@ -54,7 +54,7 @@ export default function EditQRPage() { if (qr.design_data) { setQrOptions({ ...qr.design_data, - data: qr.type === 'static' ? qr.destination_url : $baseUrl/l/ + qr.short_url_id + data: qr.type === 'static' ? qr.destination_url : `${baseUrl}/l/${qr.short_url_id}` }); } setLoading(false); @@ -70,13 +70,13 @@ export default function EditQRPage() { if (qrType === 'static') return; const val = e.target.value.replace(/[^a-zA-Z0-9-_]/g, ''); setCustomSlug(val); - setQrOptions(prev => ({ ...prev, data: $baseUrl/l/ + val })); + setQrOptions(prev => ({ ...prev, data: `${baseUrl}/l/${val}` })); }; const handleSave = async () => { try { setIsSaving(true); - await api.put(/qr/ + qrId, { + await api.put(`/qr/${qrId}`, { name: qrName, destinationUrl: destinationUrl, shortUrlId: qrType === 'dynamic' ? customSlug : undefined, @@ -129,7 +129,7 @@ export default function EditQRPage() { @@ -167,11 +167,11 @@ export default function DashboardPage() {
-
@@ -225,20 +225,20 @@ export default function DashboardPage() { {/* QR Image Custom Thumbnail */}
- +
{/* Info Area */}

{qr.name}

- +
- + {baseUrl}/l/{qr.short_url_id} @@ -273,7 +273,11 @@ export default function DashboardPage() {
- + Edit Link @@ -359,4 +363,4 @@ export default function DashboardPage() {
); -} +} \ No newline at end of file