supabase-community / storage-ex

Elixir client to interact with Supabase Storage
https://hexdocs.pm/supabase_storage
MIT License
3 stars 1 forks source link

Fix/parse json signed url #1

Closed douglastofoli closed 3 months ago

douglastofoli commented 3 months ago

Problem

The supabase_potion library returns a %Finch.Response{} struct, which broke the pattern matching inside the create_signed_url/4 function, causing issues with correctly extracting the expected data.

Solution

I updated the supabase_potion dependency in mix.exs to the latest version. Then, I modified the Fetcher call by adding the resolve_json: true option, which ensures that the response is automatically parsed as JSON, allowing the pattern matching to work as intended.

Rationale

This approach was chosen to maintain consistency with the way responses are handled across the codebase, ensuring that JSON parsing is performed centrally and pattern matching can be used effectively. Updating the library also keeps the project aligned with the latest fixes and improvements.