Use default storage location if none specified
This commit is contained in:
parent
6fa2b3b56c
commit
e685b4c045
2 changed files with 5 additions and 2 deletions
|
|
@ -293,6 +293,7 @@ public class ApiRequestBuilder(
|
|||
.UseVersioning()
|
||||
.UseAuthenticationToken()
|
||||
.UseCancellationToken(_cancellationToken)
|
||||
.AddBody(new UploadInitRequest())
|
||||
.PostAsync<UploadInitResponse>();
|
||||
|
||||
if (initResponse == null || initResponse.Key == Guid.Empty)
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue