This commit is contained in:
Leandro Facchinetti 2021-03-12 10:06:07 +00:00
parent 9b397e299f
commit d75e47bf5a
1 changed files with 2 additions and 0 deletions

View File

@ -335,12 +335,14 @@ export default function killTheNewsletter(
</p>` </p>`
) )
); );
const feedId = database.run( const feedId = database.run(
sql`INSERT INTO "feeds" ("title") VALUES (${req.body.name})` sql`INSERT INTO "feeds" ("title") VALUES (${req.body.name})`
).lastInsertRowid; ).lastInsertRowid;
const entry = database.get<{ title: string; content: HTML }>( const entry = database.get<{ title: string; content: HTML }>(
sql`SELECT "title", "content" FROM "entries" WHERE "feed" = ${feedId}` sql`SELECT "title", "content" FROM "entries" WHERE "feed" = ${feedId}`
)!; )!;
res.send( res.send(
layout(html` layout(html`
<p><strong>${entry.title}</strong></p> <p><strong>${entry.title}</strong></p>