summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-10 01:46:44 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-10 01:46:44 +0200
commit89acd570e593bb36d67b4112424dc3194ca2ffe8 (patch)
tree8b318d46963d1c1483bcb847b7e6f1df730dc325
parent1.3.45 (diff)
downloadserver-89acd570e593bb36d67b4112424dc3194ca2ffe8.tar.xz
:bug: fix ban schema
-rw-r--r--src/models/Ban.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/models/Ban.ts b/src/models/Ban.ts

index 2d1da4f0..f09950ee 100644 --- a/src/models/Ban.ts +++ b/src/models/Ban.ts
@@ -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");