Skip to content

Commit

Permalink
Improve importController
Browse files Browse the repository at this point in the history
  • Loading branch information
MiraGeowerkstatt committed Jan 14, 2025
1 parent 1c6e612 commit 0438711
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/api/Controllers/ImportController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ public async Task<ActionResult<int>> UploadJsonFileAsync(int workgroupId, IFormF
borehole.LockedById = null;
borehole.UpdatedBy = null;
borehole.CreatedBy = null;
borehole.CreatedById = user.Id;
borehole.UpdatedById = user.Id;

borehole.Stratigraphies?.MarkAsNew();
borehole.Completions?.MarkAsNew();
Expand Down Expand Up @@ -139,7 +141,10 @@ public async Task<ActionResult<int>> UploadJsonFileAsync(int workgroupId, IFormF
await context.SaveChangesAsync().ConfigureAwait(false);

// Upload attachments using the uploaded boreholes with new borehole Ids
await UploadAttachments(boreholesFile, boreholes).ConfigureAwait(false);
if (boreholes.SelectMany(b => b.BoreholeFiles).Any(f => f.File != null))

Check failure on line 144 in src/api/Controllers/ImportController.cs

View workflow job for this annotation

GitHub Actions / Build and run tests

Possible null reference return.

Check failure on line 144 in src/api/Controllers/ImportController.cs

View workflow job for this annotation

GitHub Actions / Build and run tests

Possible null reference return.

Check failure on line 144 in src/api/Controllers/ImportController.cs

View workflow job for this annotation

GitHub Actions / Run cypress tests (1)

Possible null reference return.

Check failure on line 144 in src/api/Controllers/ImportController.cs

View workflow job for this annotation

GitHub Actions / Run cypress tests (1)

Possible null reference return.

Check failure on line 144 in src/api/Controllers/ImportController.cs

View workflow job for this annotation

GitHub Actions / Run cypress tests (2)

Possible null reference return.

Check failure on line 144 in src/api/Controllers/ImportController.cs

View workflow job for this annotation

GitHub Actions / Run cypress tests (2)

Possible null reference return.

Check failure on line 144 in src/api/Controllers/ImportController.cs

View workflow job for this annotation

GitHub Actions / Run cypress tests (3)

Possible null reference return.

Check failure on line 144 in src/api/Controllers/ImportController.cs

View workflow job for this annotation

GitHub Actions / Run cypress tests (3)

Possible null reference return.

Check failure on line 144 in src/api/Controllers/ImportController.cs

View workflow job for this annotation

GitHub Actions / Run cypress tests (4)

Possible null reference return.

Check failure on line 144 in src/api/Controllers/ImportController.cs

View workflow job for this annotation

GitHub Actions / Run cypress tests (4)

Possible null reference return.

Check failure on line 144 in src/api/Controllers/ImportController.cs

View workflow job for this annotation

GitHub Actions / Run cypress tests (5)

Possible null reference return.

Check failure on line 144 in src/api/Controllers/ImportController.cs

View workflow job for this annotation

GitHub Actions / Run cypress tests (5)

Possible null reference return.
{
await UploadAttachments(boreholesFile, boreholes).ConfigureAwait(false);
}

// If any problem occurred while uploading the attachments, return a bad request.
if (!ModelState.IsValid) return ValidationProblem(statusCode: (int)HttpStatusCode.BadRequest);
Expand Down

0 comments on commit 0438711

Please sign in to comment.