Rename viewcount to viewCount for compliance

Signed-off-by: Yannick Bungers <git@innay.de>
This commit is contained in:
Yannick Bungers 2021-02-22 23:36:44 +01:00 committed by David Mehren
parent 4d89ffd474
commit 8873ac316a
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
4 changed files with 8 additions and 8 deletions

View file

@ -7,7 +7,7 @@ entity "note" {
-- --
*shortid : text *shortid : text
alias : text alias : text
*viewcount : number *viewCount : number
*ownerId : uuid <<FK user>> *ownerId : uuid <<FK user>>
description: text description: text
title: text title: text

View file

@ -47,7 +47,7 @@ export class Note {
nullable: false, nullable: false,
default: 0, default: 0,
}) })
viewcount: number; viewCount: number;
@ManyToOne((_) => User, (user) => user.ownedNotes, { onDelete: 'CASCADE' }) @ManyToOne((_) => User, (user) => user.ownedNotes, { onDelete: 'CASCADE' })
owner: User; owner: User;
@OneToMany((_) => Revision, (revision) => revision.note, { cascade: true }) @OneToMany((_) => Revision, (revision) => revision.note, { cascade: true })
@ -80,7 +80,7 @@ export class Note {
const newNote = new Note(); const newNote = new Note();
newNote.shortid = shortid; newNote.shortid = shortid;
newNote.alias = alias; newNote.alias = alias;
newNote.viewcount = 0; newNote.viewCount = 0;
newNote.owner = owner; newNote.owner = owner;
newNote.authorColors = []; newNote.authorColors = [];
newNote.userPermissions = []; newNote.userPermissions = [];

View file

@ -701,7 +701,7 @@ describe('NotesService', () => {
notes: [note], notes: [note],
}, },
]; ];
note.viewcount = 1337; note.viewCount = 1337;
const metadataDto = await service.toNoteMetadataDto(note); const metadataDto = await service.toNoteMetadataDto(note);
expect(metadataDto.id).toEqual(note.id); expect(metadataDto.id).toEqual(note.id);
expect(metadataDto.alias).toEqual(note.alias); expect(metadataDto.alias).toEqual(note.alias);
@ -725,7 +725,7 @@ describe('NotesService', () => {
expect(metadataDto.tags[0]).toEqual(note.tags[0].name); expect(metadataDto.tags[0]).toEqual(note.tags[0].name);
expect(metadataDto.updateTime).toEqual(revisions[0].createdAt); expect(metadataDto.updateTime).toEqual(revisions[0].createdAt);
expect(metadataDto.updateUser.userName).toEqual(user.userName); 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], notes: [note],
}, },
]; ];
note.viewcount = 1337; note.viewCount = 1337;
const noteDto = await service.toNoteDto(note); const noteDto = await service.toNoteDto(note);
expect(noteDto.metadata.id).toEqual(note.id); expect(noteDto.metadata.id).toEqual(note.id);
expect(noteDto.metadata.alias).toEqual(note.alias); 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.tags[0]).toEqual(note.tags[0].name);
expect(noteDto.metadata.updateTime).toEqual(revisions[0].createdAt); expect(noteDto.metadata.updateTime).toEqual(revisions[0].createdAt);
expect(noteDto.metadata.updateUser.userName).toEqual(user.userName); 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); expect(noteDto.content).toEqual(content);
}); });
}); });

View file

@ -348,7 +348,7 @@ export class NotesService {
updateUser: this.usersService.toUserDto( updateUser: this.usersService.toUserDto(
await this.calculateUpdateUser(note), await this.calculateUpdateUser(note),
), ),
viewCount: note.viewcount, viewCount: note.viewCount,
}; };
} }