Skip to content

Commit

Permalink
Merge pull request #206 from NavAbility/23Q1/stdz/getblobnotio
Browse files Browse the repository at this point in the history
getBlob as Vec{UInt8} not IO
  • Loading branch information
dehann authored Feb 21, 2023
2 parents 53133ab + c76462d commit 09280c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/navability/services/DataBlobs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function createDownloadEvent(
throw("Error: $(rootData["errors"])")
end
data = get(rootData,"data",nothing)
if data === nothing return "Error" end
if data === nothing || !haskey(data, "url") throw(KeyError("Cannot create download for $userId, requesting $blobId.\n$rootData")) end
urlMsg = get(data,"url","Error")
# TODO: What about marshalling?
return urlMsg
Expand All @@ -48,7 +48,7 @@ function getBlobEvent(
url = createDownload(client, userId, blobId) |> fetch
io = PipeBuffer()
Downloads.download(url, io)
io
io |> take!
end

getBlobEvent(client::NavAbilityClient, context::Client, blobId::UUID) = getBlobEvent(client, context.userId, blobId)
Expand Down

0 comments on commit 09280c5

Please sign in to comment.