Use default storage location if none specified

This commit is contained in:
Pat Hartl 2026-06-04 01:37:00 -05:00
parent 6fa2b3b56c
commit e685b4c045
2 changed files with 5 additions and 2 deletions

View file

@ -293,6 +293,7 @@ public class ApiRequestBuilder(
.UseVersioning()
.UseAuthenticationToken()
.UseCancellationToken(_cancellationToken)
.AddBody(new UploadInitRequest())
.PostAsync<UploadInitResponse>();
if (initResponse == null || initResponse.Key == Guid.Empty)

View file

@ -17,13 +17,15 @@ public static class UploadEndpoints
}
internal static async Task<IResult> InitAsync(
SDK.Models.UploadInitRequest request,
SDK.Models.UploadInitRequest? request,
[FromServices] StorageLocationService storageLocationService,
[FromServices] ArchiveService archiveService,
[FromServices] IFusionCache cache)
{
var storageLocationId = request?.StorageLocationId;
var storageLocation = await storageLocationService.GetOrDefaultAsync(
request.StorageLocationId == Guid.Empty ? null : request.StorageLocationId,
storageLocationId == null || storageLocationId == Guid.Empty ? null : storageLocationId,
SDK.Enums.StorageLocationType.Archive);
if (!Directory.Exists(storageLocation.Path))