From 7a1a7a7c317e3e47c13fbc61b022e0ded36bcc47 Mon Sep 17 00:00:00 2001 From: khondokartowsif171 Date: Tue, 26 May 2026 05:38:07 +0600 Subject: [PATCH] =?UTF-8?q?fix:=20mergeServices=20field=20name=20mismatch?= =?UTF-8?q?=20=E2=80=94=20demo/repo=20links=20not=20showing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Public API returns {id, demo, repo} but merge was reading {serviceId, demoUrl, gitRepo} — so dashboard links never applied. Homepage service cards will now show Demo/Repo from Control Center. Co-Authored-By: Claude Sonnet 4.6 --- src/projects.jsx | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/src/projects.jsx b/src/projects.jsx index 06caa8b..ce51154 100644 --- a/src/projects.jsx +++ b/src/projects.jsx @@ -313,27 +313,20 @@ const ProjectVisual = ({ id, tint, hover }) => { return null; }; -// Merge Dashboard API data (demo/git links, active state) into local static data +// Merge Dashboard API data (demo/repo links) into local static data +// Public API returns: { id, name, demo, repo, position } function mergeServices(local, apiData) { const byId = {}; - apiData.forEach(s => { byId[s.serviceId] = s; }); - return local - .filter(s => !byId[s.id] || byId[s.id].isActive !== false) - .map(s => { - const api = byId[s.id]; - if (!api) return s; - return { - ...s, - demo: api.demoUrl || s.demo || null, - gitRepo: api.gitRepo || null, - name: api.name || s.name, - nameBn: api.nameBn || s.nameBn, - impact: { - primary: api.impactPrimary || s.impact.primary, - secondary: api.impactSecondary || s.impact.secondary, - }, - }; - }); + apiData.forEach(s => { byId[s.id] = s; }); + return local.map(s => { + const api = byId[s.id]; + if (!api) return s; + return { + ...s, + demo: api.demo || s.demo || null, + gitRepo: api.repo || null, + }; + }); } const Projects = () => {