mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Have a different reponse model for get all
This commit is contained in:
@@ -20,20 +20,11 @@ public class AssetsController : Controller
|
||||
}
|
||||
|
||||
[HttpGet("GetAll")]
|
||||
public async Task<AssetsResponseModel> GetAllAssetModelAsync()
|
||||
public async Task<IEnumerable<AssetModel>> GetAllAssetModelAsync()
|
||||
{
|
||||
AssetsResponseModel result;
|
||||
try
|
||||
{
|
||||
var assetList = await _ldap.ListDeviceAsync();
|
||||
result = new AssetsResponseModel(successful: true, assetsModel: assetList);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
result = new AssetsResponseModel(successful: false, exception: e.Message);
|
||||
}
|
||||
var assetsList = await _ldap.ListDeviceAsync();
|
||||
|
||||
return result;
|
||||
return assetsList;
|
||||
}
|
||||
|
||||
[HttpPost("Create")]
|
||||
|
||||
Reference in New Issue
Block a user