Remove TODOs that are DONE
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user