diff --git a/AsbCloudApp/Services/IMeasureService.cs b/AsbCloudApp/Services/IMeasureService.cs index b980a75f..25dffbbc 100644 --- a/AsbCloudApp/Services/IMeasureService.cs +++ b/AsbCloudApp/Services/IMeasureService.cs @@ -9,7 +9,7 @@ namespace AsbCloudApp.Services { Task> GetCategoriesAsync(CancellationToken token); Task GetLastAsync(int idWell, int idCategory, CancellationToken token); - Task> GetHisoryAsync(int idWell, int idCategory, CancellationToken token); + Task> GetHisoryAsync(int idWell, CancellationToken token); Task> GetAllLastAsync(int idWell, CancellationToken token); Task InsertAsync(int idWell, MeasureDto data, CancellationToken token); Task UpdateAsync(int idWell, MeasureDto data, CancellationToken token); diff --git a/AsbCloudInfrastructure/Services/MeasureService.cs b/AsbCloudInfrastructure/Services/MeasureService.cs index 7735f3fe..51572001 100644 --- a/AsbCloudInfrastructure/Services/MeasureService.cs +++ b/AsbCloudInfrastructure/Services/MeasureService.cs @@ -83,10 +83,10 @@ namespace AsbCloudInfrastructure.Services return dtos; } - public async Task> GetHisoryAsync(int idWell, int idCategory, CancellationToken token) + public async Task> GetHisoryAsync(int idWell, CancellationToken token) { var query = db.Measures.Include(m => m.Category) - .Where(m => m.IdWell == idWell && m.IdCategory == idCategory && !m.IsDeleted); + .Where(m => m.IdWell == idWell && !m.IsDeleted); var entities = await query .AsNoTracking() diff --git a/AsbCloudWebApi/Controllers/MeasureController.cs b/AsbCloudWebApi/Controllers/MeasureController.cs index d134baae..6422026b 100644 --- a/AsbCloudWebApi/Controllers/MeasureController.cs +++ b/AsbCloudWebApi/Controllers/MeasureController.cs @@ -55,13 +55,13 @@ namespace AsbCloudWebApi.Controllers } [HttpGet] - [Route("history/{idCategory}")] + [Route("history")] public async Task GetHisoryAsync([FromRoute] int idWell, [FromRoute] int idCategory, CancellationToken token = default) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); - var result = await measureService.GetHisoryAsync(idWell, idCategory, token).ConfigureAwait(false); + var result = await measureService.GetHisoryAsync(idWell, token).ConfigureAwait(false); return Ok(result); }