Felhasználó és szabály törlésének befejezése
This commit is contained in:
@@ -8,10 +8,12 @@ namespace WorkFlowCheck.Web.Services.Interfaces
|
||||
Task<List<UserDTO>> GetAllUsers();
|
||||
Task<ApiResponseDTO<UserDTO>> UpdateUser(UserDTO userDTO);
|
||||
Task<ApiResponseDTO<UserDTO>> Authenticate(string username, string password);
|
||||
Task<bool> DeleteUser(int id);
|
||||
|
||||
Task<RoleDTO> GetRole(int id);
|
||||
Task<List<RoleDTO>> GetAllRoles();
|
||||
Task<ApiResponseDTO<RoleDTO>> UpdateRole(RoleDTO roleDTO);
|
||||
Task<bool> DeleteRole(int id);
|
||||
|
||||
Task<UserRoleDTO> GetUserRole(int id);
|
||||
Task<List<UserRoleDTO>> GetAllUserRoles();
|
||||
|
||||
@@ -120,7 +120,27 @@ namespace WorkFlowCheck.Web.Services
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteUser(int id)
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/User/DeleteUser/{id}";
|
||||
var retVal = false;
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<bool>>(endpoint);
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public async Task<RoleDTO> GetRole(int id)
|
||||
{
|
||||
@@ -192,7 +212,27 @@ namespace WorkFlowCheck.Web.Services
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteRole(int id)
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/User/DeleteRole/{id}";
|
||||
var retVal = false;
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetFromJsonAsync<ApiResponseDTO<bool>>(endpoint);
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
return response.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public async Task<UserRoleDTO> GetUserRole(int id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user