mirror of
https://git.boykissers.com/pawkey/pawkey-sk.git
synced 2025-12-20 04:04:16 +00:00
Make NoteEdit entity match the database schema
This commit is contained in:
@@ -26,11 +26,6 @@ export class NoteEdit {
|
||||
@JoinColumn()
|
||||
public note: MiNote | null;
|
||||
|
||||
@Column('text', {
|
||||
nullable: true,
|
||||
})
|
||||
public oldText: string | null;
|
||||
|
||||
@Column('text', {
|
||||
nullable: true,
|
||||
})
|
||||
@@ -54,8 +49,14 @@ export class NoteEdit {
|
||||
})
|
||||
public updatedAt: Date;
|
||||
|
||||
@Column('text', {
|
||||
nullable: true,
|
||||
})
|
||||
public oldText: string | null;
|
||||
|
||||
@Column('timestamp with time zone', {
|
||||
comment: 'The old date from before the edit',
|
||||
nullable: true,
|
||||
})
|
||||
public oldDate: Date;
|
||||
public oldDate: Date | null;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
|
||||
for (const edit of edits) {
|
||||
editArray.push({
|
||||
oldDate: edit.oldDate.toISOString(),
|
||||
oldDate: (edit.oldDate ?? edit.updatedAt).toISOString(),
|
||||
updatedAt: edit.updatedAt.toISOString(),
|
||||
text: edit.oldText ?? edit.newText ?? null,
|
||||
});
|
||||
|
||||
@@ -45,11 +45,9 @@ export async function getNoteVersionsMenu(props: { note: Misskey.entities.Note }
|
||||
|
||||
await statePromise.then((versions) => {
|
||||
for (const edit of versions) {
|
||||
const _time = new Date(edit.oldDate).getTime();
|
||||
|
||||
menu.push({
|
||||
icon: 'ph-pencil-simple ph-bold ph-lg',
|
||||
text: _time ? dateTimeFormat.format(_time) : dateTimeFormat.format(new Date(edit.updatedAt)),
|
||||
text: dateTimeFormat.format(new Date(edit.oldDate)),
|
||||
action: () => openVersion(edit),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user