From 8873ac316ae004a1dfdb1e2f34341aee857d68b1 Mon Sep 17 00:00:00 2001 From: Yannick Bungers Date: Mon, 22 Feb 2021 23:36:44 +0100 Subject: [PATCH] Rename viewcount to viewCount for compliance Signed-off-by: Yannick Bungers --- docs/content/dev/db-schema.plantuml | 2 +- src/notes/note.entity.ts | 4 ++-- src/notes/notes.service.spec.ts | 8 ++++---- src/notes/notes.service.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/content/dev/db-schema.plantuml b/docs/content/dev/db-schema.plantuml index 707ec9c89..2ed07aeec 100644 --- a/docs/content/dev/db-schema.plantuml +++ b/docs/content/dev/db-schema.plantuml @@ -7,7 +7,7 @@ entity "note" { -- *shortid : text alias : text - *viewcount : number + *viewCount : number *ownerId : uuid <> description: text title: text diff --git a/src/notes/note.entity.ts b/src/notes/note.entity.ts index ed2c2aae6..dd1dba79d 100644 --- a/src/notes/note.entity.ts +++ b/src/notes/note.entity.ts @@ -47,7 +47,7 @@ export class Note { nullable: false, default: 0, }) - viewcount: number; + viewCount: number; @ManyToOne((_) => User, (user) => user.ownedNotes, { onDelete: 'CASCADE' }) owner: User; @OneToMany((_) => Revision, (revision) => revision.note, { cascade: true }) @@ -80,7 +80,7 @@ export class Note { const newNote = new Note(); newNote.shortid = shortid; newNote.alias = alias; - newNote.viewcount = 0; + newNote.viewCount = 0; newNote.owner = owner; newNote.authorColors = []; newNote.userPermissions = []; diff --git a/src/notes/notes.service.spec.ts b/src/notes/notes.service.spec.ts index 9bc4c7ad8..91b89162a 100644 --- a/src/notes/notes.service.spec.ts +++ b/src/notes/notes.service.spec.ts @@ -701,7 +701,7 @@ describe('NotesService', () => { notes: [note], }, ]; - note.viewcount = 1337; + note.viewCount = 1337; const metadataDto = await service.toNoteMetadataDto(note); expect(metadataDto.id).toEqual(note.id); expect(metadataDto.alias).toEqual(note.alias); @@ -725,7 +725,7 @@ describe('NotesService', () => { expect(metadataDto.tags[0]).toEqual(note.tags[0].name); expect(metadataDto.updateTime).toEqual(revisions[0].createdAt); expect(metadataDto.updateUser.userName).toEqual(user.userName); - expect(metadataDto.viewCount).toEqual(note.viewcount); + expect(metadataDto.viewCount).toEqual(note.viewCount); }); }); @@ -795,7 +795,7 @@ describe('NotesService', () => { notes: [note], }, ]; - note.viewcount = 1337; + note.viewCount = 1337; const noteDto = await service.toNoteDto(note); expect(noteDto.metadata.id).toEqual(note.id); expect(noteDto.metadata.alias).toEqual(note.alias); @@ -825,7 +825,7 @@ describe('NotesService', () => { expect(noteDto.metadata.tags[0]).toEqual(note.tags[0].name); expect(noteDto.metadata.updateTime).toEqual(revisions[0].createdAt); expect(noteDto.metadata.updateUser.userName).toEqual(user.userName); - expect(noteDto.metadata.viewCount).toEqual(note.viewcount); + expect(noteDto.metadata.viewCount).toEqual(note.viewCount); expect(noteDto.content).toEqual(content); }); }); diff --git a/src/notes/notes.service.ts b/src/notes/notes.service.ts index 8c705b36b..09bdbe3d9 100644 --- a/src/notes/notes.service.ts +++ b/src/notes/notes.service.ts @@ -348,7 +348,7 @@ export class NotesService { updateUser: this.usersService.toUserDto( await this.calculateUpdateUser(note), ), - viewCount: note.viewcount, + viewCount: note.viewCount, }; }