diff --git a/migration/1696051309107-note-updatedAt.ts b/migration/1696051309107-note-updatedAt.ts new file mode 100644 index 0000000000..6fa1213597 --- /dev/null +++ b/migration/1696051309107-note-updatedAt.ts @@ -0,0 +1,16 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class noteUpdatedAt1696051309107 implements MigrationInterface { + name = 'noteUpdatedAt1696051309107' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "note" ADD "updatedAt" TIMESTAMP WITH TIME ZONE`); + await queryRunner.query(`COMMENT ON COLUMN "note"."updatedAt" IS 'The updated date of the Note.'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`COMMENT ON COLUMN "note"."updatedAt" IS 'The updated date of the Note.'`); + await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "updatedAt"`); + } + +} diff --git a/src/client/app/common/scripts/note-subscriber.ts b/src/client/app/common/scripts/note-subscriber.ts index ec1f71aadf..6a00314030 100644 --- a/src/client/app/common/scripts/note-subscriber.ts +++ b/src/client/app/common/scripts/note-subscriber.ts @@ -151,6 +151,13 @@ export default prop => ({ this.$_ns_target.cw = null; break; } + + case 'updated': { + Vue.set(this.$_ns_target, 'updatedAt', body.updatedAt); + Vue.set(this.$_ns_target, 'text', body.text); + Vue.set(this.$_ns_target, 'cw', body.cw); + break; + } } }, } diff --git a/src/client/app/common/views/components/note-header.vue b/src/client/app/common/views/components/note-header.vue index a72863e1dd..f7343d7f4f 100644 --- a/src/client/app/common/views/components/note-header.vue +++ b/src/client/app/common/views/components/note-header.vue @@ -13,6 +13,8 @@ + {{ }} + @@ -27,6 +29,7 @@ diff --git a/src/client/app/common/views/deck/deck.notes.vue b/src/client/app/common/views/deck/deck.notes.vue index 8033b20d86..06f8086b59 100644 --- a/src/client/app/common/views/deck/deck.notes.vue +++ b/src/client/app/common/views/deck/deck.notes.vue @@ -15,7 +15,7 @@