post.db.ts 403 Bytes
Newer Older
Lee Soobeom's avatar
Lee Soobeom committed
1
import { Posting, PostingType } from "../models";
Lee Soobeom's avatar
Lee Soobeom committed
2
import { Post, PostType } from "../models";
Lee Soobeom's avatar
Lee Soobeom committed
3
4
5
6
7
8
9
10

export const createPosting = async (posting: PostingType) => {
  const newPosting = await Posting.create({
    title: posting.title,
    text: posting.text,
    theme: posting.theme,
    city: posting.city,
    username: posting.username,
Lee Soobeom's avatar
Lee Soobeom committed
11
12
    date: posting.date,
    counts: 0,
Lee Soobeom's avatar
Lee Soobeom committed
13
14
15
  });
  return newPosting;
};