mirror of
https://github.com/spacebarchat/server.git
synced 2024-09-21 18:21:36 +02:00
🐛 fix template
This commit is contained in:
parent
ca432f99b9
commit
11450b6d39
@ -1,19 +1,7 @@
|
||||
import {
|
||||
Schema,
|
||||
model,
|
||||
Types,
|
||||
Document
|
||||
} from "mongoose";
|
||||
import { Schema, model, Types, Document } from "mongoose";
|
||||
import db from "../util/Database";
|
||||
import {
|
||||
PublicUser,
|
||||
User,
|
||||
UserModel,
|
||||
PublicUserProjection
|
||||
} from "./User";
|
||||
import {
|
||||
Guild, GuildModel
|
||||
} from "./Guild";
|
||||
import { PublicUser, User, UserModel, PublicUserProjection } from "./User";
|
||||
import { Guild, GuildModel } from "./Guild";
|
||||
|
||||
export interface Template extends Document {
|
||||
id: string;
|
||||
@ -45,9 +33,9 @@ TemplateSchema.virtual("creator", {
|
||||
ref: UserModel,
|
||||
localField: "creator_id",
|
||||
foreignField: "id",
|
||||
justOne: false,
|
||||
justOne: true,
|
||||
autopopulate: {
|
||||
select: PublicUserProjection
|
||||
select: PublicUserProjection,
|
||||
},
|
||||
});
|
||||
|
||||
@ -55,7 +43,7 @@ TemplateSchema.virtual("serialized_source_guild", {
|
||||
ref: GuildModel,
|
||||
localField: "source_guild_id",
|
||||
foreignField: "id",
|
||||
justOne: false,
|
||||
justOne: true,
|
||||
autopopulate: true,
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user