mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-28 16:50:59 -05:00
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:
parent
fe4e3d5657
commit
cdd4f58746
3 changed files with 12 additions and 12 deletions
|
@ -74,7 +74,7 @@ export class NoteGroupPermissionUpdateDto {
|
|||
*/
|
||||
@IsString()
|
||||
@ApiProperty()
|
||||
groupname: string;
|
||||
groupName: string;
|
||||
|
||||
/**
|
||||
* True if the group members should be allowed to edit the note
|
||||
|
|
|
@ -359,12 +359,12 @@ describe('NotesService', () => {
|
|||
userPermissionUpdate.username = 'hardcoded';
|
||||
userPermissionUpdate.canEdit = true;
|
||||
const groupPermissionUpate = new NoteGroupPermissionUpdateDto();
|
||||
groupPermissionUpate.groupname = 'testGroup';
|
||||
groupPermissionUpate.groupName = 'testGroup';
|
||||
groupPermissionUpate.canEdit = false;
|
||||
const user = User.create(userPermissionUpdate.username, 'Testy') as User;
|
||||
const group = Group.create(
|
||||
groupPermissionUpate.groupname,
|
||||
groupPermissionUpate.groupname,
|
||||
groupPermissionUpate.groupName,
|
||||
groupPermissionUpate.groupName,
|
||||
false,
|
||||
) as Group;
|
||||
const note = Note.create(user) as Note;
|
||||
|
@ -443,7 +443,7 @@ describe('NotesService', () => {
|
|||
});
|
||||
expect(await savedNote.userPermissions).toHaveLength(0);
|
||||
expect((await savedNote.groupPermissions)[0].group.name).toEqual(
|
||||
groupPermissionUpate.groupname,
|
||||
groupPermissionUpate.groupName,
|
||||
);
|
||||
expect((await savedNote.groupPermissions)[0].canEdit).toEqual(
|
||||
groupPermissionUpate.canEdit,
|
||||
|
@ -468,7 +468,7 @@ describe('NotesService', () => {
|
|||
userPermissionUpdate.canEdit,
|
||||
);
|
||||
expect((await savedNote.groupPermissions)[0].group.name).toEqual(
|
||||
groupPermissionUpate.groupname,
|
||||
groupPermissionUpate.groupName,
|
||||
);
|
||||
expect((await savedNote.groupPermissions)[0].canEdit).toEqual(
|
||||
groupPermissionUpate.canEdit,
|
||||
|
@ -504,7 +504,7 @@ describe('NotesService', () => {
|
|||
userPermissionUpdate.canEdit,
|
||||
);
|
||||
expect((await savedNote.groupPermissions)[0].group.name).toEqual(
|
||||
groupPermissionUpate.groupname,
|
||||
groupPermissionUpate.groupName,
|
||||
);
|
||||
expect((await savedNote.groupPermissions)[0].canEdit).toEqual(
|
||||
groupPermissionUpate.canEdit,
|
||||
|
@ -534,7 +534,7 @@ describe('NotesService', () => {
|
|||
);
|
||||
expect(await savedNote.userPermissions).toHaveLength(0);
|
||||
expect((await savedNote.groupPermissions)[0].group.name).toEqual(
|
||||
groupPermissionUpate.groupname,
|
||||
groupPermissionUpate.groupName,
|
||||
);
|
||||
expect((await savedNote.groupPermissions)[0].canEdit).toEqual(
|
||||
groupPermissionUpate.canEdit,
|
||||
|
@ -570,7 +570,7 @@ describe('NotesService', () => {
|
|||
userPermissionUpdate.canEdit,
|
||||
);
|
||||
expect((await savedNote.groupPermissions)[0].group.name).toEqual(
|
||||
groupPermissionUpate.groupname,
|
||||
groupPermissionUpate.groupName,
|
||||
);
|
||||
expect((await savedNote.groupPermissions)[0].canEdit).toEqual(
|
||||
groupPermissionUpate.canEdit,
|
||||
|
@ -613,7 +613,7 @@ describe('NotesService', () => {
|
|||
userPermissionUpdate.canEdit,
|
||||
);
|
||||
expect((await savedNote.groupPermissions)[0].group.name).toEqual(
|
||||
groupPermissionUpate.groupname,
|
||||
groupPermissionUpate.groupName,
|
||||
);
|
||||
expect((await savedNote.groupPermissions)[0].canEdit).toEqual(
|
||||
groupPermissionUpate.canEdit,
|
||||
|
|
|
@ -285,7 +285,7 @@ export class NotesService {
|
|||
);
|
||||
|
||||
const groups = newPermissions.sharedToGroups.map(
|
||||
(groupPermission) => groupPermission.groupname,
|
||||
(groupPermission) => groupPermission.groupName,
|
||||
);
|
||||
|
||||
if (checkArrayForDuplicates(users) || checkArrayForDuplicates(groups)) {
|
||||
|
@ -318,7 +318,7 @@ export class NotesService {
|
|||
// Create groupPermissions
|
||||
for (const newGroupPermission of newPermissions.sharedToGroups) {
|
||||
const group = await this.groupsService.getGroupByName(
|
||||
newGroupPermission.groupname,
|
||||
newGroupPermission.groupName,
|
||||
);
|
||||
const createdPermission = NoteGroupPermission.create(
|
||||
group,
|
||||
|
|
Loading…
Reference in a new issue