Skip to content

Commit

Permalink
fix(storage): list method using wrong encoder (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
florianmari authored May 26, 2024
1 parent dcada1a commit f16989a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/Storage/StorageFileApi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,16 @@ public class StorageFileApi: StorageApi {
path: String? = nil,
options: SearchOptions? = nil
) async throws -> [FileObject] {
let encoder = JSONEncoder()

var options = options ?? DEFAULT_SEARCH_OPTIONS
options.prefix = path ?? ""

return try await execute(
HTTPRequest(
url: configuration.url.appendingPathComponent("object/list/\(bucketId)"),
method: .post,
body: configuration.encoder.encode(options)
body: encoder.encode(options)
)
)
.decoded(decoder: configuration.decoder)
Expand Down

0 comments on commit f16989a

Please sign in to comment.