Fix responses for emoji pack controlller
This commit is contained in:
parent
7a0c755d0a
commit
3a8669b487
|
@ -88,7 +88,7 @@ defp create_archive_and_cache(name, pack, pack_dir, md5) do
|
||||||
ttl: cache_ms
|
ttl: cache_ms
|
||||||
)
|
)
|
||||||
|
|
||||||
Logger.debug("Create an archive for the '#{name}' shared emoji pack, \
|
Logger.debug("Create an archive for the '#{name}' emoji pack, \
|
||||||
keeping it in cache for #{div(cache_ms, 1000)}s")
|
keeping it in cache for #{div(cache_ms, 1000)}s")
|
||||||
|
|
||||||
zip_result
|
zip_result
|
||||||
|
@ -132,14 +132,14 @@ def download_shared(conn, %{"name" => name}) do
|
||||||
{:error,
|
{:error,
|
||||||
conn
|
conn
|
||||||
|> put_status(:forbidden)
|
|> put_status(:forbidden)
|
||||||
|> json("Pack #{name} cannot be downloaded from this instance, either pack sharing\
|
|> text("Pack #{name} cannot be downloaded from this instance, either pack sharing\
|
||||||
was disabled for this pack or some files are missing")}
|
was disabled for this pack or some files are missing")}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
{:error,
|
{:error,
|
||||||
conn
|
conn
|
||||||
|> put_status(:not_found)
|
|> put_status(:not_found)
|
||||||
|> json("Pack #{name} does not exist")}
|
|> text("Pack #{name} does not exist")}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ def download_from(conn, %{"instance_address" => address, "pack_name" => name} =
|
||||||
}}
|
}}
|
||||||
|
|
||||||
true ->
|
true ->
|
||||||
{:error, "The pack was not set as shared and the is no fallback url to download from"}
|
{:error, "The pack was not set as shared and there is no fallback src to download from"}
|
||||||
end
|
end
|
||||||
|
|
||||||
case pack_info_res do
|
case pack_info_res do
|
||||||
|
|
Loading…
Reference in New Issue