fix: Prevent webhook delivery for deleted teams

This commit is contained in:
Tom Moor
2022-08-08 11:15:04 +02:00
parent 1b00d51c74
commit b45e6c504f

View File

@@ -8,6 +8,7 @@ import {
DataType,
IsUrl,
BeforeCreate,
DefaultScope,
} from "sequelize-typescript";
import { SaveOptions } from "sequelize/types";
import { WebhookSubscriptionValidation } from "@shared/validations";
@@ -19,6 +20,14 @@ import ParanoidModel from "./base/ParanoidModel";
import Fix from "./decorators/Fix";
import Length from "./validators/Length";
@DefaultScope(() => ({
include: [
{
association: "team",
required: true,
},
],
}))
@Table({
tableName: "webhook_subscriptions",
modelName: "webhook_subscription",