mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
Merge branch 'fix-realtime-timeline-on-staging' into 'master'
fixed realtime not working on staging See merge request fyipe-project/app!1809
This commit is contained in:
@@ -82,9 +82,10 @@ router.get(
|
||||
async function(req, res) {
|
||||
try {
|
||||
const idNumber = req.params.incidentId;
|
||||
const incidentId = await IncidentService.getIncidentId({
|
||||
let incidentId = await IncidentService.getIncidentId({
|
||||
idNumber,
|
||||
});
|
||||
incidentId = incidentId._id;
|
||||
const skip = req.query.skip || 0;
|
||||
const limit = req.query.limit || 10;
|
||||
const alerts = await alertService.findBy({
|
||||
|
||||
@@ -29,6 +29,7 @@ const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
const subscriberAlertService = require('../services/subscriberAlertService');
|
||||
const onCallScheduleStatusService = require('../services/onCallScheduleStatusService');
|
||||
const Services = require('../utils/services');
|
||||
const { lessThan } = require('../utils/DateTime');
|
||||
|
||||
// Route
|
||||
// Description: Creating incident.
|
||||
@@ -277,9 +278,10 @@ router.get(
|
||||
// Call the IncidentService.
|
||||
|
||||
try {
|
||||
const incidentId = await IncidentService.getIncidentId({
|
||||
let incidentId = await IncidentService.getIncidentId({
|
||||
idNumber: req.params.incidentId,
|
||||
});
|
||||
incidentId = incidentId._id;
|
||||
const incident = await IncidentService.findOneBy({
|
||||
_id: incidentId,
|
||||
});
|
||||
@@ -920,9 +922,10 @@ router.get(
|
||||
try {
|
||||
let incidentMessages, result;
|
||||
const idNumber = req.params.incidentId;
|
||||
const incidentId = await IncidentService.getIncidentId({
|
||||
let incidentId = await IncidentService.getIncidentId({
|
||||
idNumber,
|
||||
});
|
||||
incidentId = incidentId._id;
|
||||
const projectId = req.params.projectId;
|
||||
if (type === 'investigation') {
|
||||
incidentMessages = await IncidentMessageService.findBy(
|
||||
|
||||
@@ -99,7 +99,8 @@ router.get('/:projectId/incident/:incidentId', async (req, res) => {
|
||||
try {
|
||||
const projectId = req.params.projectId;
|
||||
const idNumber = req.params.incidentId;
|
||||
const incidentId = await IncidentService.getIncidentId({ idNumber });
|
||||
let incidentId = await IncidentService.getIncidentId({ idNumber });
|
||||
incidentId = incidentId._id;
|
||||
const skip = req.query.skip || 0;
|
||||
const limit = req.query.limit || 10;
|
||||
const subscriberAlerts = await SubscriberAlertService.findBy(
|
||||
|
||||
@@ -267,8 +267,8 @@ module.exports = {
|
||||
|
||||
getIncidentId: async function(query) {
|
||||
try {
|
||||
const incidentId = await IncidentModel.findOne(query);
|
||||
return incidentId._id;
|
||||
const incident = await IncidentModel.findOne(query);
|
||||
return incident;
|
||||
} catch (error) {
|
||||
ErrorService.log('incidentService.getIncidentId', error);
|
||||
throw error;
|
||||
|
||||
@@ -35,9 +35,12 @@ module.exports = {
|
||||
? project.parentProjectId._id
|
||||
: project._id
|
||||
: timeline.projectId;
|
||||
const { idNumber } = await IncidentService.getIncidentId({
|
||||
_id: timeline.incidentId,
|
||||
});
|
||||
|
||||
const data = {
|
||||
incidentId: timeline.incidentId,
|
||||
incidentId: idNumber,
|
||||
incidentMessages: timeline.data,
|
||||
count: timeline.data.length,
|
||||
type: 'internal',
|
||||
|
||||
Reference in New Issue
Block a user