generate random UUIDs for bookings

This commit is contained in:
Thomas Ruoff
2020-08-20 00:31:27 +02:00
parent 3a5f5b3204
commit b2ca0515c1
4 changed files with 15 additions and 4 deletions

View File

@@ -1,7 +1,12 @@
import { v4 as uuidv4 } from 'uuid'
import * as mongoose from 'mongoose'
const BookerSchema = new mongoose.Schema(
{
_id: {
type: String,
default: uuidv4,
},
name: { type: String, required: true },
email: { type: String, required: true, unique: true, minlength: 5 },
street: { type: String, required: true },