Essential backend functionality, including logins.

This commit is contained in:
2019-08-21 12:52:12 +02:00
parent d2168ab4a0
commit 99f2c5e7d8
14 changed files with 3965 additions and 1 deletions

28
api/models/bookModel.js Normal file
View File

@@ -0,0 +1,28 @@
'use strict';
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const BookSchema = new Schema({
title: {
type: String,
required: 'Book title missing'
},
publication_date: {
type: Date,
default: Date(0)
},
quantity: {
type: Number,
default: 1
},
amount_loaned: {
type: Number,
default: 0
},
isbn13: {
type: String,
required: 'Book ISBN-13 missing'
}
});
module.exports = mongoose.model('Book', BookSchema);