fix(admin): truncate spam titles + speed up table view

This commit is contained in:
Young Lee
2026-02-06 00:11:32 -08:00
parent 223560e874
commit 022c188873
8 changed files with 289 additions and 123 deletions
+6 -4
View File
@@ -101,7 +101,7 @@ export async function createFeed(
}));
// Add feed to the list of all feeds
await addFeedToList(kv, feedId, feedConfig.title);
await addFeedToList(kv, feedId, feedConfig.title, feedConfig.description);
}
/**
@@ -110,7 +110,8 @@ export async function createFeed(
export async function addFeedToList(
kv: KVNamespace,
feedId: string,
title: string
title: string,
description?: string
): Promise<void> {
const feedListKey = 'feeds:list';
const existingList = await kv.get(feedListKey, { type: 'json' }) as FeedList | null;
@@ -119,7 +120,8 @@ export async function addFeedToList(
feedList.feeds.push({
id: feedId,
title
title,
description
});
await kv.put(feedListKey, JSON.stringify(feedList));
@@ -133,4 +135,4 @@ export async function getAllFeeds(kv: KVNamespace): Promise<FeedList> {
const feedList = await kv.get(feedListKey, { type: 'json' }) as FeedList | null;
return feedList || { feeds: [] };
}
}