Skip to content

Commit

Permalink
Fix file_info_query and delete_entity_command.
Browse files Browse the repository at this point in the history
  • Loading branch information
ba1ash committed Dec 18, 2023
1 parent 12b1dda commit 80a670e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,10 @@ def call(user:, file_id:)
def file_info(file_id, token)
response = Util
.httpx
.get(
Util.join_uri_path(@uri, FILE_INFO_PATH, file_id),
{
'Authorization' => "Bearer #{token.access_token}",
'Accept' => 'application/json',
'OCS-APIRequest' => 'true'
}
)
.with(headers: { 'Authorization' => "Bearer #{token.access_token}",
'Accept' => 'application/json',
'OCS-APIRequest' => 'true' })
.get(Util.join_uri_path(@uri, FILE_INFO_PATH, file_id))

case response.status
when 200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class DeleteEntityCommand

def initialize(storage)
@uri = storage.uri
@base_path =
@username = storage.username
@password = storage.password
end
Expand All @@ -45,7 +44,9 @@ def call(location:)
response = UTIL
.httpx
.basic_auth(@username, @password)
.delete(UTIL.join_uri_path(@uri, "remote.php/dav/files", CGI.escapeURIComponent(@username), UTIL.escape_path(location)))
.delete(UTIL.join_uri_path(@uri, "remote.php/dav/files",
CGI.escapeURIComponent(@username),
UTIL.escape_path(location)))

case response.status
when 204
Expand Down

0 comments on commit 80a670e

Please sign in to comment.