diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-13 13:00:16 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-13 13:00:16 +0200 |
commit | 11353dabfd95df510d7f054ed4acbd28c8bb4e1f (patch) | |
tree | 33eca0beeb91d6efdb7730c0964644c484e9ebf9 /rtc/src/models/Template.ts | |
parent | rename @fosscord/server-util to -> @fosscord/util (diff) | |
download | server-11353dabfd95df510d7f054ed4acbd28c8bb4e1f.tar.xz |
cleanup rtc
Diffstat (limited to 'rtc/src/models/Template.ts')
-rw-r--r-- | rtc/src/models/Template.ts | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/rtc/src/models/Template.ts b/rtc/src/models/Template.ts deleted file mode 100644 index ad0f9104..00000000 --- a/rtc/src/models/Template.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { Schema, model, Types, Document } from "mongoose"; -import db from "../util/Database"; -import { PublicUser, User, UserModel, PublicUserProjection } from "./User"; -import { Guild, GuildModel } from "./Guild"; - -export interface Template extends Document { - id: string; - code: string; - name: string; - description?: string; - usage_count?: number; - creator_id: string; - creator: User; - created_at: Date; - updated_at: Date; - source_guild_id: String; - serialized_source_guild: Guild; -} - -export const TemplateSchema = new Schema({ - id: String, - code: String, - name: String, - description: String, - usage_count: Number, - creator_id: String, - created_at: Date, - updated_at: Date, - source_guild_id: String, -}); - -TemplateSchema.virtual("creator", { - ref: UserModel, - localField: "creator_id", - foreignField: "id", - justOne: true, - autopopulate: { - select: PublicUserProjection, - }, -}); - -TemplateSchema.virtual("serialized_source_guild", { - ref: GuildModel, - localField: "source_guild_id", - foreignField: "id", - justOne: true, - autopopulate: true, -}); - -// @ts-ignore -export const TemplateModel = db.model<Template>("Template", TemplateSchema, "templates"); |