Newer
Older
taehui / taehui-fe / src / app / www / systems / commentary.ts
@Taehui Taehui on 17 Mar 812 bytes 2024-03-17 오후 11:29
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);
};