diff options
author | Raphael <mail@raphaelkabo.com> | 2023-10-06 16:54:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-06 16:54:03 +0100 |
commit | a14afed944e5f0b87af96cc5c6a262d246b88d1d (patch) | |
tree | 26104aa7f2717ea7e8f69734a2181d456f264481 /src/models/EventGroup.ts | |
parent | f390b1d45b3f44a860fef4df2b31064f441b5065 (diff) | |
parent | 722d54e5ae8957436818b14e7aea613b19b12d28 (diff) |
Merge pull request #111 from lowercasename/rk/typescript
Typescript migration
Diffstat (limited to 'src/models/EventGroup.ts')
-rwxr-xr-x | src/models/EventGroup.ts | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/src/models/EventGroup.ts b/src/models/EventGroup.ts index f097843..2b5c2aa 100755 --- a/src/models/EventGroup.ts +++ b/src/models/EventGroup.ts @@ -1,75 +1,75 @@ import mongoose from "mongoose"; export interface ISubscriber { - email?: string; + email?: string; } export interface IEventGroup extends mongoose.Document { - id: string; - name: string; - description: string; - image?: string; - url?: string; - creatorEmail?: string; - hostName?: string; - editToken?: string; - firstLoad?: boolean; - events?: mongoose.Types.ObjectId[]; - subscribers?: ISubscriber[]; + id: string; + name: string; + description: string; + image?: string; + url?: string; + creatorEmail?: string; + hostName?: string; + editToken?: string; + firstLoad?: boolean; + events?: mongoose.Types.ObjectId[]; + subscribers?: ISubscriber[]; } const Subscriber = new mongoose.Schema({ - email: { - type: String, - trim: true, - }, + email: { + type: String, + trim: true, + }, }); const EventGroupSchema = new mongoose.Schema({ - id: { - type: String, - required: true, - unique: true, - }, - name: { - type: String, - trim: true, - required: true, - }, - description: { - type: String, - trim: true, - required: true, - }, - image: { - type: String, - trim: true, - }, - url: { - type: String, - trim: true, - }, - creatorEmail: { - type: String, - trim: true, - }, - hostName: { - type: String, - trim: true, - }, - editToken: { - type: String, - trim: true, - minlength: 32, - maxlength: 32, - }, - firstLoad: { - type: Boolean, - trim: true, - default: true, - }, - events: [{ type: mongoose.Schema.Types.ObjectId, ref: "Event" }], - subscribers: [Subscriber], + id: { + type: String, + required: true, + unique: true, + }, + name: { + type: String, + trim: true, + required: true, + }, + description: { + type: String, + trim: true, + required: true, + }, + image: { + type: String, + trim: true, + }, + url: { + type: String, + trim: true, + }, + creatorEmail: { + type: String, + trim: true, + }, + hostName: { + type: String, + trim: true, + }, + editToken: { + type: String, + trim: true, + minlength: 32, + maxlength: 32, + }, + firstLoad: { + type: Boolean, + trim: true, + default: true, + }, + events: [{ type: mongoose.Schema.Types.ObjectId, ref: "Event" }], + subscribers: [Subscriber], }); export default mongoose.model<IEventGroup>("EventGroup", EventGroupSchema); |