post.db.ts 315 Bytes
Newer Older
Lee Soobeom's avatar
Lee Soobeom committed
1
import { Post, PostType } from "../models";
Lee Soobeom's avatar
Lee Soobeom committed
2

Lee Soobeom's avatar
Lee Soobeom committed
3
4
5
6
7
8
9
10
export const createPost = async (post: PostType) => {
  const newPosting = await Post.create({
    title: post.title,
    text: post.text,
    theme: post.theme,
    city: post.city,
    user: post.user,
    date: post.date,
Lee Soobeom's avatar
Lee Soobeom committed
11
    counts: 0,
Lee Soobeom's avatar
Lee Soobeom committed
12
13
14
  });
  return newPosting;
};