mirror of
https://github.com/svemagie/indiekit-endpoint-blogroll.git
synced 2026-04-02 15:34:59 +02:00
fix: convert Date objects to ISO strings for blog edit items
The Indiekit date filter calls parseISO() which expects a string. MongoDB returns Date objects for item.published, causing "dateString.split is not a function" error on the blog edit page. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -157,7 +157,14 @@ async function edit(request, response) {
|
|||||||
return response.status(404).render("404");
|
return response.status(404).render("404");
|
||||||
}
|
}
|
||||||
|
|
||||||
const items = await getItemsForBlog(application, blog._id, 10);
|
const rawItems = await getItemsForBlog(application, blog._id, 10);
|
||||||
|
const items = rawItems.map((item) => ({
|
||||||
|
...item,
|
||||||
|
published:
|
||||||
|
item.published instanceof Date
|
||||||
|
? item.published.toISOString()
|
||||||
|
: item.published,
|
||||||
|
}));
|
||||||
|
|
||||||
response.render("blogroll-blog-edit", {
|
response.render("blogroll-blog-edit", {
|
||||||
title: request.__("blogroll.blogs.edit"),
|
title: request.__("blogroll.blogs.edit"),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@rmdes/indiekit-endpoint-blogroll",
|
"name": "@rmdes/indiekit-endpoint-blogroll",
|
||||||
"version": "1.0.8",
|
"version": "1.0.9",
|
||||||
"description": "Blogroll endpoint for Indiekit. Aggregates blog feeds from OPML, JSON feeds, or manual entry.",
|
"description": "Blogroll endpoint for Indiekit. Aggregates blog feeds from OPML, JSON feeds, or manual entry.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"indiekit",
|
"indiekit",
|
||||||
|
|||||||
Reference in New Issue
Block a user