Skip to content

Commit 7399932

Browse files
committed
Fix bundlephobia search
1 parent 2fb8667 commit 7399932

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

apps/components_guide/lib/components_guide/research/spec.ex

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ defmodule ComponentsGuide.Research.Spec do
5151
end
5252

5353
def search_for(:bundlephobia, query) when is_binary(query) do
54-
{:ok, data} = Source.json_at("https://bundlephobia.com/api/size?package=#{query}")
54+
case Source.json_at("https://bundlephobia.com/api/size?package=#{query}") do
55+
{:ok, data} ->
56+
data
5557

56-
data
58+
_ ->
59+
nil
60+
end
5761
end
5862

5963
defp process_search_for(:caniuse, query, {:ok, data}) when is_binary(query) do

apps/components_guide_web/lib/components_guide_web/controllers/research_controller.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ defmodule ComponentsGuideWeb.ResearchController do
8989
[]
9090

9191
other ->
92-
inspect(other)
92+
[]
9393
end
9494
end
9595

0 commit comments

Comments
 (0)