21 lines
510 B
JavaScript
21 lines
510 B
JavaScript
|
import { isoDate } from "../utilities.mjs"
|
||
|
import logger from "../logger.mjs"
|
||
|
import { sampleRes } from "./db.mjs"
|
||
|
|
||
|
export async function insertPublished(db, res, word) {
|
||
|
logger.trace("insertPublished called")
|
||
|
return db('published')
|
||
|
.insert({
|
||
|
id: res.createdNote.id,
|
||
|
word,
|
||
|
date: isoDate(sampleRes.createdNote.createdAt)
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export const insertIntoBuffer = async (db,word,timestamp) => {
|
||
|
return db('buffer')
|
||
|
.insert({
|
||
|
word:word,
|
||
|
timestamp:timestamp
|
||
|
})
|
||
|
}
|