Skip to content
Snippets Groups Projects
Commit 5901b5ae authored by Ahmad, Rezwan (PG/T - Comp Sci & Elec Eng)'s avatar Ahmad, Rezwan (PG/T - Comp Sci & Elec Eng)
Browse files

User Schema Created

parent d6aacd1b
No related branches found
No related tags found
1 merge request!9Create endpoint for user-registration
......@@ -17,5 +17,5 @@ export async function register(req,res){
}
*/
export async function login(req,res){
res.json('register route')
res.json('login route')
}
\ No newline at end of file
import mongoose from "mongoose";
export const UserSchema = new mongoose.Schema({
username : {
type: String,
required : [true, "Please provide unique Username"],
unique: [true, "Username Exist"]
},
password: {
type: String,
required: [true, "Please provide a password"],
unique : false,
},
email: {
type: String,
required : [true, "Please provide a unique email"],
unique: true,
},
firstName: { type: String},
lastName: { type: String},
mobile : { type : Number},
profile: { type: String}
});
export default mongoose.model.Users || mongoose.model('User', UserSchema);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment