/[sudobot]/trunk/src/models/User.ts
ViewVC logotype

Contents of /trunk/src/models/User.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 348 - (show annotations)
Mon Jul 29 17:29:43 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: application/typescript
File size: 754 byte(s)
feat: user controller
1 import { Schema, model, Document } from 'mongoose';
2
3 export interface IUser extends Document {
4 discord_id: string;
5 username: string;
6 guilds: Array<string>;
7 password?: string;
8 token?: string;
9 createdAt: Date;
10 }
11
12 const schema = new Schema({
13 username: {
14 type: String,
15 required: true,
16 unique: true
17 },
18 discord_id: {
19 type: String,
20 required: true,
21 },
22 guilds: {
23 type: Array,
24 required: true,
25 default: []
26 },
27 password: {
28 type: String,
29 required: false
30 },
31 token: {
32 type: String,
33 required: false
34 },
35 createdAt: {
36 type: Date,
37 required: true,
38 }
39 });
40
41 export default model('User', schema);

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26