mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 23:17:12 +01:00
put models in file not schema
This commit is contained in:
14
db/booker.js
Normal file
14
db/booker.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as mongoose from 'mongoose'
|
||||
|
||||
const BookerSchema = new mongoose.Schema(
|
||||
{
|
||||
name: { type: String, required: true },
|
||||
email: { type: String, required: true, unique: true, minlength: 5 },
|
||||
street: { type: String, required: true },
|
||||
zip: { type: String, required: true },
|
||||
city: { type: String, required: true },
|
||||
},
|
||||
{ timestamps: true }
|
||||
)
|
||||
|
||||
export default mongoose.models.Booker || mongoose.model('Booker', BookerSchema)
|
||||
Reference in New Issue
Block a user