-
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
Showing
7 changed files
with
64 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export const exampleUser1 = { | ||
id: "65f3c6c85ec12921d8bbd0e3", | ||
isAdmin: true, | ||
imageUrl: | ||
"https://media.licdn.com/dms/image/v2/D5603AQHN8gWRzyN-3g/profile-displayphoto-shrink_800_800/profile-displayphoto-shrink_800_800/0/1710110275806?e=1731542400&v=beta&t=8XE8qDedoImTZo1QhvletOkhHasb31BCT4MBuj2OLkY", | ||
email: "[email protected]", | ||
name: "Vin Bui", | ||
}; | ||
|
||
export const exampleUser2 = { | ||
id: "65f3c6c85ec12921d8bbd0e4", | ||
isAdmin: false, | ||
imageUrl: | ||
"https://media.licdn.com/dms/image/v2/D4E03AQGe3o27d-Y5Eg/profile-displayphoto-shrink_800_800/profile-displayphoto-shrink_800_800/0/1725558867182?e=1731542400&v=beta&t=JatU-XhdnisKyaWefPALJdB-3lU44C1RtkXY-uhPs6A", | ||
email: "[email protected]", | ||
name: "Lauren Jun", | ||
}; | ||
|
||
export const exampleUsers = [exampleUser1, exampleUser2]; |
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,34 @@ | ||
import { | ||
getModelForClass, | ||
prop, | ||
modelOptions, | ||
Severity, | ||
} from "@typegoose/typegoose"; | ||
|
||
@modelOptions({ | ||
schemaOptions: { | ||
toJSON: { | ||
virtuals: true, | ||
versionKey: false, | ||
transform: function (doc, ret) { | ||
delete ret._id; | ||
}, | ||
}, | ||
}, | ||
options: { allowMixed: Severity.ALLOW }, | ||
}) | ||
export class User { | ||
@prop({ unique: true }) | ||
public email!: string; | ||
|
||
@prop() | ||
public imageUrl!: string; | ||
|
||
@prop({ default: false }) | ||
public isAdmin!: boolean; | ||
|
||
@prop() | ||
public name!: string; | ||
} | ||
|
||
export const UserModel = getModelForClass(User); |
Empty file.
Empty file.
Empty file.