feat: Added configuration of events by webhook of instances

This commit is contained in:
Davidson Gomes
2023-06-12 14:40:26 -03:00
parent 0f360d34e8
commit fc30bb9852
8 changed files with 81 additions and 9 deletions

View File

@@ -5,12 +5,14 @@ export class WebhookRaw {
_id?: string;
url?: string;
enabled?: boolean;
events?: string[];
}
const webhookSchema = new Schema<WebhookRaw>({
_id: { type: String, _id: true },
url: { type: String, required: true },
enabled: { type: Boolean, required: true },
events: { type: [String], required: true },
});
export const WebhookModel = dbserver?.model(WebhookRaw.name, webhookSchema, 'webhook');