mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-25 03:09:32 -06:00
remove userID and teamID from status page
This commit is contained in:
@@ -24,7 +24,13 @@ class StatusPageController {
|
||||
}
|
||||
|
||||
try {
|
||||
const statusPage = await this.db.createStatusPage(req.body, req.file);
|
||||
const { _id, teamId } = req.user;
|
||||
const statusPage = await this.db.createStatusPage({
|
||||
statusPageData: req.body,
|
||||
image: req.file,
|
||||
userId: _id,
|
||||
teamId,
|
||||
});
|
||||
return res.success({
|
||||
msg: this.stringService.statusPageCreate,
|
||||
data: statusPage,
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
import StatusPage from "../../models/StatusPage.js";
|
||||
import Monitor from "../../models/Monitor.js";
|
||||
import { NormalizeData } from "../../../utils/dataUtils.js";
|
||||
import ServiceRegistry from "../../../service/serviceRegistry.js";
|
||||
import StringService from "../../../service/stringService.js";
|
||||
|
||||
const SERVICE_NAME = "statusPageModule";
|
||||
|
||||
const createStatusPage = async (statusPageData, image) => {
|
||||
const createStatusPage = async ({ statusPageData, image, userId, teamId }) => {
|
||||
const stringService = ServiceRegistry.get(StringService.SERVICE_NAME);
|
||||
|
||||
try {
|
||||
const statusPage = new StatusPage({ ...statusPageData });
|
||||
const statusPage = new StatusPage({
|
||||
...statusPageData,
|
||||
userId,
|
||||
teamId,
|
||||
});
|
||||
if (image) {
|
||||
statusPage.logo = {
|
||||
data: image.buffer,
|
||||
|
||||
@@ -424,8 +424,6 @@ const getStatusPageQueryValidation = joi.object({
|
||||
});
|
||||
|
||||
const createStatusPageBodyValidation = joi.object({
|
||||
userId: joi.string().required(),
|
||||
teamId: joi.string().required(),
|
||||
type: joi.string().valid("uptime").required(),
|
||||
companyName: joi.string().required(),
|
||||
url: joi
|
||||
|
||||
Reference in New Issue
Block a user