Create team on superadmin create
This commit is contained in:
1 parent
4c2cc6fb2c
commit
a6f5c96f93
3 files changed
+29
-7
No files matched your search
+11
-7
@@ -1,12 +1,16 @@
|
||||
const mongoose = require("mongoose");
|
||||
|
||||
const TeamSchema = mongoose.Schema({
|
||||
userId: {
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: "User",
|
||||
immutable: true,
|
||||
const TeamSchema = mongoose.Schema(
|
||||
{
|
||||
email: {
|
||||
type: String,
|
||||
required: true,
|
||||
unique: true,
|
||||
},
|
||||
},
|
||||
timestamps: true,
|
||||
});
|
||||
{
|
||||
timestamps: true,
|
||||
}
|
||||
);
|
||||
|
||||
module.exports = mongoose.model("Team", TeamSchema);
|
||||
@@ -40,6 +40,11 @@ const UserSchema = mongoose.Schema(
|
||||
default: "user",
|
||||
enum: ["user", "admin", "superadmin"],
|
||||
},
|
||||
teamId: {
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: "Team",
|
||||
immutable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
|
||||
Reference in new issue
Block a user