From 163827d4a8dbc4b41bfa0f78edc7dd30626e95d3 Mon Sep 17 00:00:00 2001 From: transtrike Date: Tue, 19 Jan 2021 19:02:37 +0200 Subject: Fixed role id creeping up the chain --- src/DevHive.Services/Services/RoleService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/DevHive.Services/Services/RoleService.cs') diff --git a/src/DevHive.Services/Services/RoleService.cs b/src/DevHive.Services/Services/RoleService.cs index 0945624..3ebb7c8 100644 --- a/src/DevHive.Services/Services/RoleService.cs +++ b/src/DevHive.Services/Services/RoleService.cs @@ -47,15 +47,15 @@ namespace DevHive.Services.Services return this._roleMapper.Map(role); } - public async Task UpdateRole(RoleServiceModel roleServiceModel) + public async Task UpdateRole(UpdateRoleServiceModel updateRoleServiceModel) { - if (!await this._roleRepository.DoesRoleExist(roleServiceModel.Id)) + if (!await this._roleRepository.DoesRoleExist(updateRoleServiceModel.Id)) throw new ArgumentException("Role does not exist!"); - if (await this._roleRepository.DoesNameExist(roleServiceModel.Name)) + if (await this._roleRepository.DoesNameExist(updateRoleServiceModel.Name)) throw new ArgumentException("Role name already exists!"); - Role role = this._roleMapper.Map(roleServiceModel); + Role role = this._roleMapper.Map(updateRoleServiceModel); return await this._roleRepository.EditAsync(role); } -- cgit v1.2.3