Skip to content

Commit

Permalink
update_node on new pages
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrocp committed Jan 17, 2025
1 parent 0baeb06 commit 9da9f01
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/beacon/live_admin/live/page_editor_live/edit.ex
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ defmodule Beacon.LiveAdmin.PageEditorLive.Edit do
end

def handle_event("update_page_node", %{"node_id" => path, "node" => node}, socket) do
# TODO: update the ast node
send_update(Beacon.LiveAdmin.PageEditorLive.FormComponent,
id: "page-editor-form",
path: path,
Expand Down
10 changes: 10 additions & 0 deletions lib/beacon/live_admin/live/page_editor_live/new.ex
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ defmodule Beacon.LiveAdmin.PageEditorLive.New do
{:noreply, socket}
end

def handle_event("update_page_node", %{"node_id" => path, "node" => node}, socket) do
send_update(Beacon.LiveAdmin.PageEditorLive.FormComponent,
id: "page-editor-form",
path: path,
node: node
)

{:noreply, socket}
end

def handle_event("select_element", %{"path" => path}, socket) do
ElementSelection.select_element(path, socket)
end
Expand Down

0 comments on commit 9da9f01

Please sign in to comment.