make stuff more consistent
This commit is contained in:
parent
ff084d679c
commit
79cc7e87c7
@ -10,7 +10,7 @@ class Incident extends BeanModel {
|
|||||||
async resolve() {
|
async resolve() {
|
||||||
this.active = false;
|
this.active = false;
|
||||||
this.pin = false;
|
this.pin = false;
|
||||||
this.lastUpdatedDate = R.isoDateTime(dayjs.utc());
|
this.last_updated_date = R.isoDateTime(dayjs.utc());
|
||||||
await R.store(this);
|
await R.store(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,8 +26,8 @@ class Incident extends BeanModel {
|
|||||||
content: this.content,
|
content: this.content,
|
||||||
pin: !!this.pin,
|
pin: !!this.pin,
|
||||||
active: !!this.active,
|
active: !!this.active,
|
||||||
createdDate: this.createdDate,
|
createdDate: this.created_date,
|
||||||
lastUpdatedDate: this.lastUpdatedDate,
|
lastUpdatedDate: this.last_updated_date,
|
||||||
status_page_id: this.status_page_id,
|
status_page_id: this.status_page_id,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -533,11 +533,11 @@ class StatusPage extends BeanModel {
|
|||||||
if (lastIncident) {
|
if (lastIncident) {
|
||||||
const moreCount = await R.count("incident", " status_page_id = ? AND created_date < ? ", [
|
const moreCount = await R.count("incident", " status_page_id = ? AND created_date < ? ", [
|
||||||
statusPageId,
|
statusPageId,
|
||||||
lastIncident.createdDate,
|
lastIncident.created_date,
|
||||||
]);
|
]);
|
||||||
hasMore = moreCount > 0;
|
hasMore = moreCount > 0;
|
||||||
if (hasMore) {
|
if (hasMore) {
|
||||||
nextCursor = lastIncident.createdDate;
|
nextCursor = lastIncident.created_date;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -61,9 +61,9 @@ module.exports.statusPageSocketHandler = (socket) => {
|
|||||||
incidentBean.status_page_id = statusPageID;
|
incidentBean.status_page_id = statusPageID;
|
||||||
|
|
||||||
if (incident.id) {
|
if (incident.id) {
|
||||||
incidentBean.lastUpdatedDate = R.isoDateTime(dayjs.utc());
|
incidentBean.last_updated_date = R.isoDateTime(dayjs.utc());
|
||||||
} else {
|
} else {
|
||||||
incidentBean.createdDate = R.isoDateTime(dayjs.utc());
|
incidentBean.created_date = R.isoDateTime(dayjs.utc());
|
||||||
}
|
}
|
||||||
|
|
||||||
await R.store(incidentBean);
|
await R.store(incidentBean);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user