Skip to content
Snippets Groups Projects

Transaction 추가 및 로그인, 회원가입 validate 적용, backend api 라우터 정리

Merged LeeYongJae requested to merge transaction into master
17 files
+ 548
331
Compare changes
  • Side-by-side
  • Inline
Files
17
+ 0
31
@@ -9,40 +9,9 @@ const BookSchema = new Schema({
major: { type: String },
type: { type: String },
src: { type: String },
seller: [
{
seller_id: { type: String },
on_transaction: { type: Boolean }
}
],
stock: { type: Number }
});
BookSchema.statics.create = function(Book_info) {
const {
title,
grade,
major,
type,
src,
stock,
seller: []
} = Book_info;
const Book = new this({
title,
grade,
major,
type,
src,
stock,
seller: []
});
// return the Promise
return Book.save();
};
autoInc.initialize(mongoose.connection);
BookSchema.plugin(autoInc.plugin, "Book");
Loading