Skip to content

Commit

Permalink
Added balance option in the User Model
Browse files Browse the repository at this point in the history
  • Loading branch information
iampavangandhi committed Aug 1, 2020
1 parent f61b201 commit eca8fd4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/passport.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = function (passport) {
firstName: profile.name.givenName,
lastName: profile.name.familyName,
image: profile.photos[0].value,
balance: 10000,
};

try {
Expand Down
5 changes: 5 additions & 0 deletions models/User.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// User Model (Google OAuth)

const mongoose = require("mongoose");
var Float = require("mongoose-float").loadType(mongoose);

const UserSchema = new mongoose.Schema({
googleId: {
Expand All @@ -22,6 +23,10 @@ const UserSchema = new mongoose.Schema({
image: {
type: String,
},
balance: {
type: Float,
required: true,
},
createdAt: {
type: Date,
default: Date.now,
Expand Down

0 comments on commit eca8fd4

Please sign in to comment.