mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-20 22:03:48 +00:00
fix(admin): truncate spam titles + speed up table view
This commit is contained in:
@@ -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: [] };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user