April 2020
Intermediate to advanced
716 pages
18h 55m
English
The Order schema defined in server/models/course.model.js will contain fields for storing the customer's name and email, along with their user account reference, delivery address information, payment reference, created and updated-at timestamps, and an array of products ordered. The pieces of code for defining the order fields are as follows:
customer_name: { type: String, trim: true, required: 'Name is required' },customer_email: { type: String, trim: true, match: [/.+\@.+\..+/, 'Please fill a valid email address'], required: 'Email is required' }
Read now
Unlock full access