🐛 fix ban schema
This commit is contained in:
parent
67f94fb015
commit
89acd570e5
@ -20,11 +20,13 @@ export const BanSchema = new Schema({
|
|||||||
|
|
||||||
BanSchema.virtual("user", {
|
BanSchema.virtual("user", {
|
||||||
ref: UserModel,
|
ref: UserModel,
|
||||||
localField: "id",
|
localField: "user_id",
|
||||||
foreignField: "user_id",
|
foreignField: "id",
|
||||||
justOne: true,
|
justOne: true,
|
||||||
autopopulate: { select: PublicUserProjection },
|
autopopulate: { select: PublicUserProjection },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
BanSchema.set("removeResponse", ["user_id"]);
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export const BanModel = db.model<Ban>("Ban", BanSchema, "bans");
|
export const BanModel = db.model<Ban>("Ban", BanSchema, "bans");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user