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