make stuff more consistent

This commit is contained in:
ryana 2026-01-20 11:35:25 +08:00
parent ff084d679c
commit 79cc7e87c7
3 changed files with 7 additions and 7 deletions

View File

@ -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,
};
}

View File

@ -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;
}
}

View File

@ -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);