Merge pull request #5760 from tchak/fix-graphql-upload

[GraphQL] fix attachment upload
This commit is contained in:
Paul Chavard 2020-11-25 11:03:01 +01:00 committed by GitHub
commit 708cc20b95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -5,6 +5,7 @@ module Mutations
begin begin
blob = ActiveStorage::Blob.find_signed(blob_id) blob = ActiveStorage::Blob.find_signed(blob_id)
blob.identify blob.identify
nil
rescue ActiveStorage::FileNotFoundError rescue ActiveStorage::FileNotFoundError
return { errors: ['Le fichier na pas été correctement téléversé sur le serveur de stockage'] } return { errors: ['Le fichier na pas été correctement téléversé sur le serveur de stockage'] }
rescue ActiveSupport::MessageVerifier::InvalidSignature rescue ActiveSupport::MessageVerifier::InvalidSignature

View file

@ -37,7 +37,7 @@ describe API::V2::GraphqlController do
} }
end end
let(:blob) do let(:blob) do
blob = ActiveStorage::Blob.create_before_direct_upload!(blob_info) blob = ActiveStorage::Blob.create_before_direct_upload!(**blob_info)
blob.upload(file) blob.upload(file)
blob blob
end end