mainimg.db.ts 392 Bytes
Newer Older
백승민's avatar
백승민 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { Mainimg, MainimgType } from "../models";

export const createMainimg = async (mainimg: MainimgType) => {
  const newMainimg = await Mainimg.create({
    theme: mainimg.theme,
    city: mainimg.city,
    url: mainimg.url,
    title: mainimg.title,
  });
  return newMainimg;
};

export const getMainimg = async () => {
    const users = await Mainimg.find({});
    return users;
  };