Skip to content

Commit

Permalink
[api][webui] Set the response properly in Backend::File#destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
Moises Deniz Aleman committed Apr 19, 2017
1 parent 803746b commit 2a25c7f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/api/lib/backend/file.rb
Expand Up @@ -96,9 +96,10 @@ def save(query = {}, content = nil)

# Tries to destroy the file from the backend, freeze the object and return the response, otherwise will raise an StandardError
def destroy!(query = {})
response = Connection.delete(full_path(query))
backend_response = Connection.delete(full_path(query))
@response = { type: backend_response['Content-Type'], status: backend_response.code, size: backend_response.content_length }
freeze
response
@response
end

# Tries to destroy the file from the backend. Returns nil if some StandardError is raised
Expand Down

0 comments on commit 2a25c7f

Please sign in to comment.