Skip to content

Commit

Permalink
chore: remove page.template from visual editor payload (#722)
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrocp authored Jan 10, 2025
1 parent f917d29 commit 86ffe3a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/beacon/web/controllers/api/page_json.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ defmodule Beacon.Web.API.PageJSON do
layout_id: page.layout_id,
path: page.path,
site: page.site,
template: page.template,
format: page.format,
ast: page_ast(page, assigns)
}
Expand All @@ -50,12 +49,12 @@ defmodule Beacon.Web.API.PageJSON do
end
end

defp maybe_include_layout(%{template: page_template} = data, %Page{layout: %Layout{} = layout}, assigns) do
defp maybe_include_layout(data, %Page{layout: %Layout{} = layout} = page, assigns) do
layout =
layout
|> Map.from_struct()
|> Map.drop([:__meta__])
|> Map.put(:ast, layout_ast(layout, page_template, assigns))
|> Map.put(:ast, layout_ast(layout, page.template, assigns))

Map.put(data, :layout, layout)
end
Expand Down

0 comments on commit 86ffe3a

Please sign in to comment.