upd: store old date and use it in previous versions
This commit is contained in:
parent
2706b6b618
commit
83be996a3d
6 changed files with 27 additions and 6 deletions
|
@ -50,12 +50,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
|
||||
for (const edit of edits) {
|
||||
editArray.push({
|
||||
oldDate: edit.oldDate,
|
||||
updatedAt: edit.updatedAt,
|
||||
text: edit.oldText,
|
||||
});
|
||||
}
|
||||
|
||||
editArray = editArray.sort((a, b) => { return new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime(); });
|
||||
editArray = editArray.sort((a, b) => { return new Date(b.oldDate).getTime() - new Date(a.oldDate).getTime(); });
|
||||
|
||||
return editArray;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue