import { postDb } from "../db"; import { asyncWrap } from "../helpers/asyncWrap"; export const postup = asyncWrap(async (req, res) => { const {id, title, date,body , theme, city }=req.body; if (theme == "테마") { return res.status(422).send("테마를 선택해주십시요."); }else if(city =="도시"){ return res.status(422).send("도시를 선택해주십시요."); } const newPost = await postDb.createPost({ id, title, date, body,theme, city }); res.json(newPost); })