1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 05:02:37 +01:00

🐛 fix ban schema

This commit is contained in:
Flam3rboy 2021-08-10 01:46:44 +02:00
parent 67f94fb015
commit 89acd570e5

View File

@ -20,11 +20,13 @@ export const BanSchema = new Schema({
BanSchema.virtual("user", {
ref: UserModel,
localField: "id",
foreignField: "user_id",
localField: "user_id",
foreignField: "id",
justOne: true,
autopopulate: { select: PublicUserProjection },
});
BanSchema.set("removeResponse", ["user_id"]);
// @ts-ignore
export const BanModel = db.model<Ban>("Ban", BanSchema, "bans");