factored out, moved to db.mjs

This commit is contained in:
Andrzej Stepien 2023-08-13 13:00:24 +02:00
parent a7c66c86ec
commit e54767c09c
1 changed files with 0 additions and 17 deletions

View File

@ -1,17 +0,0 @@
import { db } from "./db.mjs";
import { isoDate } from "../utilities.mjs";
import logger from "../logger.mjs";
export default async function todaysPromptAlreadyPublished() {
try {
const number = await db('published')
.count('* as count')
.where('date', isoDate())
return number[0].count > 0
} catch (error) {
logger.error("todaysPromptAlreadyPublished failed!")
throw error
}
}
//console.log(await todaysPromptAlreadyPublished())