import DB from "@/app/www/system/DB"; import { getDatetime } from "taehui-ts/date"; export const getCommentary = async () => { return DB.getCommentary(); }; export const postCommentary = async ( avatarName: string, avatarCipher: string, avatarIP: string, text: string, ) => { return ( text && avatarCipher && DB.postCommentary(avatarName, avatarCipher, avatarIP, getDatetime(), text) ); }; export const doModifyCommentary = async ( commentaryID: number, avatarCipher: string, text: string, ) => { return ( avatarCipher && text && DB.doModifyCommentary(commentaryID, avatarCipher, text) ); }; export const wipeCommentary = async ( commentaryID: number, avatarCipher: string, ) => { return avatarCipher && DB.wipeCommentary(commentaryID, avatarCipher); };