Merge pull request #5760 from tchak/fix-graphql-upload
[GraphQL] fix attachment upload
This commit is contained in:
commit
708cc20b95
2 changed files with 2 additions and 1 deletions
|
@ -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 n’a pas été correctement téléversé sur le serveur de stockage'] }
|
return { errors: ['Le fichier n’a pas été correctement téléversé sur le serveur de stockage'] }
|
||||||
rescue ActiveSupport::MessageVerifier::InvalidSignature
|
rescue ActiveSupport::MessageVerifier::InvalidSignature
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue