From 9bf177f97101c7e393ba15b7d33aaea687a71d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B3=E5=85=83=E7=9A=93?= Date: Thu, 5 Jun 2025 23:57:55 +0800 Subject: [PATCH] Add apis into the api page & for now (devlog demo) don't save stuff into the db. --- pages/apis.vue | 18 ++++++++++++++++++ server/api/publishers/lt/[slug].ts | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/pages/apis.vue b/pages/apis.vue index ef1f67c..51ba25e 100644 --- a/pages/apis.vue +++ b/pages/apis.vue @@ -45,6 +45,24 @@ const apis = [ caching: true, openAccess: true, }, + { + icon: NewspaperIcon, + apiroute: "/api/platform/lt_all", + name: "Get the news article from LT", + content: + "Using the native /api/publishers/lt/[slug] thingy, it will use the stuff from the publishers lt endpoint to get & store data, and will be viewable via this endpoint.", + caching: true, + openAccess: true, + }, + { + icon: NewspaperIcon, + apiroute: "/api/publishers/lt/[slug]", + name: "Get publishers from LT", + content: + "This endpoint requires the slug to be filled in, in order to get it to work.", + caching: true, + openAccess: true, + }, { icon: BotMessageSquareIcon, apiroute: "/api/ai/chat/[slug]", diff --git a/server/api/publishers/lt/[slug].ts b/server/api/publishers/lt/[slug].ts index 629c61a..f088046 100644 --- a/server/api/publishers/lt/[slug].ts +++ b/server/api/publishers/lt/[slug].ts @@ -91,9 +91,9 @@ export default defineEventHandler(async (event) => { }); } }); - const pushNewsOrg = await sql` + /*const pushNewsOrg = await sql` insert into - ` + `*/ cache[slug] = { slug: slug, title: newsOrgName,