micro365/database-calls/todaysPromptAlreadyPublishe...

12 lines
365 B
JavaScript
Raw Normal View History

2023-08-10 18:18:42 +00:00
import { db } from "./db.mjs";
2023-08-12 10:05:24 +00:00
import { isoDate } from "../utilities.mjs";
2023-08-10 18:18:42 +00:00
export default async function todaysPromptAlreadyPublished() {
const number = await db('published')
2023-08-11 12:40:19 +00:00
.count('* as count')
.where('date', isoDate())
2023-08-11 14:21:24 +00:00
.catch(error=>{throw error})
2023-08-10 18:18:42 +00:00
return number[0].count > 0
}
2023-08-11 14:21:24 +00:00
//console.log(await todaysPromptAlreadyPublished())