mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-12 20:02:28 +08:00
fix(server/tasks): missing utcDateModified causing errors on create
This commit is contained in:
parent
c00505cd7b
commit
373e0b45f2
@ -1,3 +1,4 @@
|
|||||||
|
import date_utils from "../../services/date_utils.js";
|
||||||
import AbstractBeccaEntity from "./abstract_becca_entity.js";
|
import AbstractBeccaEntity from "./abstract_becca_entity.js";
|
||||||
import type BOption from "./boption.js";
|
import type BOption from "./boption.js";
|
||||||
import type { TaskRow } from "./rows.js";
|
import type { TaskRow } from "./rows.js";
|
||||||
@ -45,6 +46,7 @@ export default class BTask extends AbstractBeccaEntity<BOption> {
|
|||||||
this.dueDate = row.dueDate;
|
this.dueDate = row.dueDate;
|
||||||
this.isDone = !!row.isDeleted;
|
this.isDone = !!row.isDeleted;
|
||||||
this._isDeleted = !!row.isDeleted;
|
this._isDeleted = !!row.isDeleted;
|
||||||
|
this.utcDateModified = row.utcDateModified;
|
||||||
|
|
||||||
if (this.taskId) {
|
if (this.taskId) {
|
||||||
this.becca.tasks[this.taskId] = this;
|
this.becca.tasks[this.taskId] = this;
|
||||||
@ -57,13 +59,20 @@ export default class BTask extends AbstractBeccaEntity<BOption> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected beforeSaving(opts?: {}): void {
|
||||||
|
super.beforeSaving();
|
||||||
|
|
||||||
|
this.utcDateModified = date_utils.utcNowDateTime();
|
||||||
|
}
|
||||||
|
|
||||||
getPojo() {
|
getPojo() {
|
||||||
return {
|
return {
|
||||||
taskId: this.taskId,
|
taskId: this.taskId,
|
||||||
parentNoteId: this.parentNoteId,
|
parentNoteId: this.parentNoteId,
|
||||||
title: this.title,
|
title: this.title,
|
||||||
dueDate: this.dueDate,
|
dueDate: this.dueDate,
|
||||||
isDeleted: this.isDeleted
|
isDeleted: this.isDeleted,
|
||||||
|
utcDateModified: this.utcDateModified
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,4 +144,5 @@ export interface TaskRow {
|
|||||||
dueDate?: string;
|
dueDate?: string;
|
||||||
isDone?: boolean;
|
isDone?: boolean;
|
||||||
isDeleted?: boolean;
|
isDeleted?: boolean;
|
||||||
|
utcDateModified: string;
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ export interface FTaskRow {
|
|||||||
title: string;
|
title: string;
|
||||||
dueDate?: string;
|
dueDate?: string;
|
||||||
isDone?: boolean;
|
isDone?: boolean;
|
||||||
|
utcDateModified: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class FTask {
|
export default class FTask {
|
||||||
@ -15,6 +16,7 @@ export default class FTask {
|
|||||||
title!: string;
|
title!: string;
|
||||||
dueDate?: string;
|
dueDate?: string;
|
||||||
isDone!: boolean;
|
isDone!: boolean;
|
||||||
|
utcDateModified!: string;
|
||||||
|
|
||||||
constructor(froca: Froca, row: FTaskRow) {
|
constructor(froca: Froca, row: FTaskRow) {
|
||||||
this.froca = froca;
|
this.froca = froca;
|
||||||
@ -27,5 +29,6 @@ export default class FTask {
|
|||||||
this.title = row.title;
|
this.title = row.title;
|
||||||
this.dueDate = row.dueDate;
|
this.dueDate = row.dueDate;
|
||||||
this.isDone = !!row.isDone;
|
this.isDone = !!row.isDone;
|
||||||
|
this.utcDateModified = row.utcDateModified;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user