Selaa lähdekoodia

Use authors instead of author in jsonfeed

Thomas Dy 2 vuotta sitten
vanhempi
commit
b1363c8b6d
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 3 3
      index.ts

+ 3 - 3
index.ts

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