Skip to content

Commit

Permalink
Fetch inspection using isar inspection Id
Browse files Browse the repository at this point in the history
  • Loading branch information
mrica-equinor committed Dec 13, 2024
1 parent be7d191 commit 885e694
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/api/Controllers/InspectionController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ public async Task<ActionResult<Inspection>> GetInspectionImageById([FromRoute] s
return StatusCode(StatusCodes.Status500InternalServerError);
}

if (inspection.Id == null) return NotFound($"Could not find Id for Inspection with task ID {taskId}.");
if (inspection.IsarInspectionId == null) return NotFound($"Could not find isar inspection Id {inspection.IsarInspectionId} for Inspection with task ID {taskId}.");

var inspectionData = await inspectionService.GetInspectionStorageInfo(inspection.Id);
var inspectionData = await inspectionService.GetInspectionStorageInfo(inspection.IsarInspectionId);

if (inspectionData == null) return NotFound($"Could not find inspection data for inspection with Id {inspection.Id}.");
if (inspectionData == null) return NotFound($"Could not find inspection data for inspection with isar Id {inspection.IsarInspectionId}.");

if (!inspectionData.BlobContainer.ToLower(CultureInfo.CurrentCulture).Equals(installationCode.ToLower(CultureInfo.CurrentCulture), StringComparison.Ordinal))
{
return NotFound($"Could not find inspection data for inspection with Id {inspection.Id} because blob name {inspectionData.BlobName} does not match installation {installationCode}.");
return NotFound($"Could not find inspection data for inspection with isar Id {inspection.IsarInspectionId} because blob name {inspectionData.BlobName} does not match installation {installationCode}.");
}

try
Expand Down

0 comments on commit 885e694

Please sign in to comment.