mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
feat: add isGuest field in user model
This commit is contained in:
1 parent
b07b60f6bd
commit
14cd16b611
2 files changed
+7
No files matched your search
@@ -28,6 +28,7 @@ export interface IUser {
|
||||
socialLogins: Map<string, ISocialLogin>
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
isGuest: boolean
|
||||
}
|
||||
|
||||
export const User = model<IUser>(
|
||||
@@ -51,6 +52,11 @@ export const User = model<IUser>(
|
||||
default: {},
|
||||
required: true,
|
||||
},
|
||||
isGuest: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
|
||||
@@ -37,6 +37,7 @@ export async function createGuestUser() {
|
||||
const user = new User({
|
||||
username,
|
||||
email: `${username}@example.com`,
|
||||
isGuest: true,
|
||||
})
|
||||
await user.save()
|
||||
|
||||
|
||||
Reference in new issue
Block a user