refactor(note-group-permission-update-dto): rename attribute groupName

For consistency with NoteGroupPermissionEntryDto

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2022-01-16 22:46:46 +01:00
parent b40b2e164f
commit 96ed5f3cc8
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
3 changed files with 12 additions and 12 deletions

View file

@ -74,7 +74,7 @@ export class NoteGroupPermissionUpdateDto {
*/ */
@IsString() @IsString()
@ApiProperty() @ApiProperty()
groupname: string; groupName: string;
/** /**
* True if the group members should be allowed to edit the note * True if the group members should be allowed to edit the note

View file

@ -359,12 +359,12 @@ describe('NotesService', () => {
userPermissionUpdate.username = 'hardcoded'; userPermissionUpdate.username = 'hardcoded';
userPermissionUpdate.canEdit = true; userPermissionUpdate.canEdit = true;
const groupPermissionUpate = new NoteGroupPermissionUpdateDto(); const groupPermissionUpate = new NoteGroupPermissionUpdateDto();
groupPermissionUpate.groupname = 'testGroup'; groupPermissionUpate.groupName = 'testGroup';
groupPermissionUpate.canEdit = false; groupPermissionUpate.canEdit = false;
const user = User.create(userPermissionUpdate.username, 'Testy') as User; const user = User.create(userPermissionUpdate.username, 'Testy') as User;
const group = Group.create( const group = Group.create(
groupPermissionUpate.groupname, groupPermissionUpate.groupName,
groupPermissionUpate.groupname, groupPermissionUpate.groupName,
false, false,
) as Group; ) as Group;
const note = Note.create(user) as Note; const note = Note.create(user) as Note;
@ -443,7 +443,7 @@ describe('NotesService', () => {
}); });
expect(await savedNote.userPermissions).toHaveLength(0); expect(await savedNote.userPermissions).toHaveLength(0);
expect((await savedNote.groupPermissions)[0].group.name).toEqual( expect((await savedNote.groupPermissions)[0].group.name).toEqual(
groupPermissionUpate.groupname, groupPermissionUpate.groupName,
); );
expect((await savedNote.groupPermissions)[0].canEdit).toEqual( expect((await savedNote.groupPermissions)[0].canEdit).toEqual(
groupPermissionUpate.canEdit, groupPermissionUpate.canEdit,
@ -468,7 +468,7 @@ describe('NotesService', () => {
userPermissionUpdate.canEdit, userPermissionUpdate.canEdit,
); );
expect((await savedNote.groupPermissions)[0].group.name).toEqual( expect((await savedNote.groupPermissions)[0].group.name).toEqual(
groupPermissionUpate.groupname, groupPermissionUpate.groupName,
); );
expect((await savedNote.groupPermissions)[0].canEdit).toEqual( expect((await savedNote.groupPermissions)[0].canEdit).toEqual(
groupPermissionUpate.canEdit, groupPermissionUpate.canEdit,
@ -504,7 +504,7 @@ describe('NotesService', () => {
userPermissionUpdate.canEdit, userPermissionUpdate.canEdit,
); );
expect((await savedNote.groupPermissions)[0].group.name).toEqual( expect((await savedNote.groupPermissions)[0].group.name).toEqual(
groupPermissionUpate.groupname, groupPermissionUpate.groupName,
); );
expect((await savedNote.groupPermissions)[0].canEdit).toEqual( expect((await savedNote.groupPermissions)[0].canEdit).toEqual(
groupPermissionUpate.canEdit, groupPermissionUpate.canEdit,
@ -534,7 +534,7 @@ describe('NotesService', () => {
); );
expect(await savedNote.userPermissions).toHaveLength(0); expect(await savedNote.userPermissions).toHaveLength(0);
expect((await savedNote.groupPermissions)[0].group.name).toEqual( expect((await savedNote.groupPermissions)[0].group.name).toEqual(
groupPermissionUpate.groupname, groupPermissionUpate.groupName,
); );
expect((await savedNote.groupPermissions)[0].canEdit).toEqual( expect((await savedNote.groupPermissions)[0].canEdit).toEqual(
groupPermissionUpate.canEdit, groupPermissionUpate.canEdit,
@ -570,7 +570,7 @@ describe('NotesService', () => {
userPermissionUpdate.canEdit, userPermissionUpdate.canEdit,
); );
expect((await savedNote.groupPermissions)[0].group.name).toEqual( expect((await savedNote.groupPermissions)[0].group.name).toEqual(
groupPermissionUpate.groupname, groupPermissionUpate.groupName,
); );
expect((await savedNote.groupPermissions)[0].canEdit).toEqual( expect((await savedNote.groupPermissions)[0].canEdit).toEqual(
groupPermissionUpate.canEdit, groupPermissionUpate.canEdit,
@ -613,7 +613,7 @@ describe('NotesService', () => {
userPermissionUpdate.canEdit, userPermissionUpdate.canEdit,
); );
expect((await savedNote.groupPermissions)[0].group.name).toEqual( expect((await savedNote.groupPermissions)[0].group.name).toEqual(
groupPermissionUpate.groupname, groupPermissionUpate.groupName,
); );
expect((await savedNote.groupPermissions)[0].canEdit).toEqual( expect((await savedNote.groupPermissions)[0].canEdit).toEqual(
groupPermissionUpate.canEdit, groupPermissionUpate.canEdit,

View file

@ -285,7 +285,7 @@ export class NotesService {
); );
const groups = newPermissions.sharedToGroups.map( const groups = newPermissions.sharedToGroups.map(
(groupPermission) => groupPermission.groupname, (groupPermission) => groupPermission.groupName,
); );
if (checkArrayForDuplicates(users) || checkArrayForDuplicates(groups)) { if (checkArrayForDuplicates(users) || checkArrayForDuplicates(groups)) {
@ -318,7 +318,7 @@ export class NotesService {
// Create groupPermissions // Create groupPermissions
for (const newGroupPermission of newPermissions.sharedToGroups) { for (const newGroupPermission of newPermissions.sharedToGroups) {
const group = await this.groupsService.getGroupByName( const group = await this.groupsService.getGroupByName(
newGroupPermission.groupname, newGroupPermission.groupName,
); );
const createdPermission = NoteGroupPermission.create( const createdPermission = NoteGroupPermission.create(
group, group,