Defined new schema for the config object.

This commit is contained in:
Skorpios committed 2025-02-16 19:32:52 -08:00
1 parent 07882e045b
commit 8409571d57
4 files changed
+66 -40

No files matched your search

+10 -5
View File
@@ -1,4 +1,11 @@
import mongoose from "mongoose";
const configSchema = mongoose.Schema({
webhookUrl: { type: String },
botToken: { type: String },
chatId: { type: String }
}, { _id: false });
const NotificationSchema = mongoose.Schema(
{
monitorId: {
@@ -11,11 +18,9 @@ const NotificationSchema = mongoose.Schema(
enum: ["email", "sms", "webhook"],
},
config: {
type: String,
webhookUrl: String,
botToken: String,
chatId: String
},
type: configSchema,
default: () => ({})
},
address: {
type: String,
},