Commit 8bd19e51 authored by Lee SeoYeon's avatar Lee SeoYeon
Browse files

.

parent 94ab062d
This diff is collapsed.
......@@ -2,7 +2,6 @@ import User from "../models/User.js"
import isLength from 'validator/lib/isLength.js'
import isEmail from "validator/lib/isEmail.js"
import bcrypt from "bcryptjs";
const reviews = ("../models/Review.js");
const signup = async (req, res) => {
const { name, email, password } = req.body //구조분해해서 하나씩
......@@ -61,35 +60,4 @@ const userById = async (req, res, next, id) => {
// }
// }
const bookMark = async(req, res, next) => {
const { title, link, content } = req.body; // 비구조화 할당
console.log(req.body);
let bookmark = []
const newBookmark = await new Bookmark ({
}).save()
var reviewModel = new reviews();
reviewModel.title = title;
reviewModel.content = content;
reviewModel.link = link;
reviewModel
.save()
.then(newReview => {
console.log("Create 완료");
res.status(200).json({
message: "Create success",
data: {
review: newReview
}
});
})
.catch(err => {
res.status(500).json({
message: err
});
});
};
export default { signup, userById, bookMark }
\ No newline at end of file
export default { signup, userById}
\ No newline at end of file
......@@ -3,6 +3,16 @@ import mongoose from "mongoose";
const { String } = mongoose.Schema.Types
const { Array } = mongoose.Schema.Types
const { Schema } = mongoose;
const { Types: { ObjectId } } = Schema;
const ReserveSchema = new Schema({
user: {
type: ObjectId,
required: true,
ref: 'User',
},
})
const UserSchema = new mongoose.Schema({
name: {
type: String,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment