Browse Source

Use authors instead of author in jsonfeed

Thomas Dy 2 years ago
parent
commit
b1363c8b6d
1 changed files with 3 additions and 3 deletions
  1. 3 3
      index.ts

+ 3 - 3
index.ts

@@ -157,8 +157,8 @@ class Server {
     const emails = await this.getLatestEmails(recipient, 24 * 60 * 60);
     console.time("renderJSON");
     const items = emails.map(({ id, email, receivedAt }) => {
-      const author = email.from
-        ? { name: `${email.from.name} <${email.from.address}>` }
+      const authors = email.from
+        ? [{ name: `${email.from.name} <${email.from.address}>` }]
         : undefined;
       return {
         id,
@@ -166,7 +166,7 @@ class Server {
         content_text: email.text ?? "<No Content>",
         content_html: email.html,
         date_published: email.date ?? receivedAt.toString(),
-        author,
+        authors,
       };
     });
     const json = JSON.stringify({