Newer
Older
taehui / taehui-fe / src / app / www / avatar / getTotem / route.ts
@Taehui Taehui on 17 Mar 466 bytes 2024-03-17 오후 11:29
import logIP from "@/app/www/mws/logIP";
import validateMillis from "@/app/www/mws/validateMillis";
import { getTotem } from "@/app/www/systems/avatar";

export const POST = logIP(
  validateMillis(async (req) => {
    const { avatarID, avatarCipher } = await req.json();

    const totem = await getTotem(avatarID, avatarCipher);
    if (totem) {
      return Response.json(totem);
    } else {
      return new Response(undefined, { status: 403 });
    }
  }),
);