Skip to content

Commit f2f2a53

Browse files
authored
fix: do not ignore missing context on Ash.PlugHelpers.update_context/2 (#2674)
Previously, it was swallowing the case when context was not yet initialized. Currently, it will just call the callback and set the context.
1 parent b4a63c0 commit f2f2a53

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

lib/ash/plug_helpers.ex

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,9 @@ if Code.ensure_loaded?(Plug.Conn) do
244244
@spec update_context(Conn.t(), (nil | map() -> nil | map())) ::
245245
Conn.t()
246246
def update_context(conn, callback) do
247-
case get_context(conn) do
248-
nil ->
249-
conn
250-
251-
context ->
252-
conn
253-
|> set_context(callback.(context))
254-
end
247+
get_context(conn)
248+
|> callback.()
249+
|> set_context()
255250
end
256251
end
257252
else

0 commit comments

Comments
 (0)