Have a different reponse model for get all

This commit is contained in:
anomny
2025-10-06 21:25:10 +02:00
parent c25e196814
commit 1d26781e8e
2 changed files with 4 additions and 17 deletions

View File

@@ -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")]