From 99079cc2bbc714f9bd72c5bc22f1171f1a462d02 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 10 Feb 2025 10:20:21 -0800 Subject: [PATCH] add userId and teamId to status pages --- Server/db/models/StatusPage.js | 12 ++++++++++++ Server/validation/joi.js | 2 ++ 2 files changed, 14 insertions(+) diff --git a/Server/db/models/StatusPage.js b/Server/db/models/StatusPage.js index 2f9898300..0ca8a1266 100644 --- a/Server/db/models/StatusPage.js +++ b/Server/db/models/StatusPage.js @@ -2,6 +2,18 @@ import mongoose from "mongoose"; const StatusPageSchema = mongoose.Schema( { + userId: { + type: mongoose.Schema.Types.ObjectId, + ref: "User", + immutable: true, + required: true, + }, + teamId: { + type: mongoose.Schema.Types.ObjectId, + ref: "Team", + immutable: true, + required: true, + }, companyName: { type: String, required: true, diff --git a/Server/validation/joi.js b/Server/validation/joi.js index 349ac9fcb..fe0220853 100644 --- a/Server/validation/joi.js +++ b/Server/validation/joi.js @@ -419,6 +419,8 @@ const getStatusPageParamValidation = joi.object({ }); const createStatusPageBodyValidation = joi.object({ + userId: joi.string().required(), + teamId: joi.string().required(), companyName: joi.string().required(), url: joi.string().required(), timezone: joi.string().optional(),