mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
add shared
This commit is contained in:
22
shared/schema/UserSchema.ts
Normal file
22
shared/schema/UserSchema.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { model, Schema } from 'mongoose';
|
||||
|
||||
export type TUser = {
|
||||
email: string,
|
||||
name: string,
|
||||
given_name: string,
|
||||
locale: string,
|
||||
picture: string,
|
||||
created_at: Date
|
||||
}
|
||||
|
||||
const UserSchema = new Schema<TUser>({
|
||||
email: { type: String, unique: true, index: 1 },
|
||||
name: String,
|
||||
given_name: String,
|
||||
locale: String,
|
||||
picture: String,
|
||||
created_at: { type: Date, default: () => Date.now() }
|
||||
})
|
||||
|
||||
export const UserModel = model<TUser>('users', UserSchema);
|
||||
|
||||
Reference in New Issue
Block a user