From a5b2424969177b3eb9916e109d80c18bc8b2ceac Mon Sep 17 00:00:00 2001 From: Perception Date: Thu, 7 Jan 2021 10:47:01 -0800 Subject: [PATCH] Remove TODOs that are DONE --- index.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index 3d37a6a..8cf7b92 100644 --- a/index.js +++ b/index.js @@ -108,7 +108,6 @@ async function articleExists(db, slug) { return res.c > 0 } -// TODO rename to fetchArticle async function fetchArticle(url) { const res = await axios.get(url) const $ = cheerio.load(res.data) @@ -201,7 +200,6 @@ async function insertTag(db, name) { async function insertArticle(db, article) { try { // TODO wrap in a transaction? - // insert into article const [year, month] = article.published_date.split(/-/) article.year = year @@ -255,12 +253,6 @@ async function searchCount(db, query) { return res.c } -// TODO write a function to insert an article into the database -// TODO write a function to insert a category into the database -// TODO write a function to associate an article with categories in a database -// TODO write a function to scan a category for articles -// TODO write a function to scrape an article into an insertable object - // summaries for home page async function getYears() { @@ -380,7 +372,7 @@ async function countArticlesByCategory(db, name) { JOIN article__category ac ON a.id = ac.article_id JOIN category c ON c.id = ac.category_id WHERE c.name = @name - `).get({ name }) + `).get({ name }) return count.c } @@ -412,7 +404,7 @@ async function countArticlesByTag(db, name) { JOIN article__tag a_t ON a.id = a_t.article_id JOIN tag c ON c.id = a_t.tag_id WHERE c.name = @name - `).get({ name }) + `).get({ name }) return count.c }