-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Henrique Sagara
authored and
Henrique Sagara
committed
Feb 19, 2024
1 parent
30be54e
commit d7ce3c1
Showing
9 changed files
with
1,062 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { client, dbName, collectionName, connectToDatabase } from "./database.js"; | ||
import bcrypt from "bcrypt"; | ||
import dotenv from "dotenv"; | ||
dotenv.config(); | ||
|
||
const uri = process.env.MONGODB_URI; | ||
|
||
const userSchema = new mongoose.Schema({ | ||
name: { type: String, required: true}, | ||
email: {type: String, required: true, unique: true}, | ||
password: {type: String, required: true}, | ||
manager: {type: String}, | ||
isManager: { type: Boolean, default: false}, | ||
}); | ||
|
||
let User; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +0,0 @@ | ||
import mongoose from "mongoose"; | ||
|
||
const userSchema = new mongoose.Schema({ | ||
name: { type: String, required: true}, | ||
email: {type: String, required: true, unique: true}, | ||
password: {type: String, required: true}, | ||
manager: {type: String}, | ||
isManager: { type: Boolean, default: false}, | ||
}); | ||
|
||
const User = mongoose.model('User', userSchema); | ||
|
||
module.exports = User; | ||
Oops, something went wrong.