From 3fc424bb859ec68f82f0c5d27f3df604760464ff Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Fri, 10 Oct 2025 10:48:59 -0700 Subject: [PATCH] Revert: Update list.js --- functions/api/links/list.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/functions/api/links/list.js b/functions/api/links/list.js index 117ed26..f706d32 100644 --- a/functions/api/links/list.js +++ b/functions/api/links/list.js @@ -9,20 +9,13 @@ export async function onRequestPost({ request, env }) { let slugs = []; try { const parsed = JSON.parse(user.custom_slugs); - if (Array.isArray(parsed)) slugs = parsed.reverse(); + if (Array.isArray(parsed)) slugs = parsed; } catch {} - if (slugs.length === 0) return Response.json([]); - - const linkDetails = await Promise.all( - slugs.map(async slug => ({ - slug, - destination: await env.KV_EV.get(slug) || 'Destination not found' - })) - ); - - return Response.json(linkDetails); + return Response.json(slugs); } catch (e) { return new Response(e.message, { status: 500 }); } } + +