Skip to content

Commit 8320fca

Browse files
committed
Can create todos on the server now
1 parent ff83bd4 commit 8320fca

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

assets/src/actions/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ export function addTodo(text) {
6161
dispatch(addTodoRequest(text));
6262

6363
let payload = {
64-
text: text
64+
label: text,
65+
completed: false
6566
};
6667

6768
channel.push('new:todo', payload)

lib/todo_test_web/channels/todo_channel.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ defmodule TodoTestWeb.TodoChannel do
2424
end
2525

2626
def handle_in("new:todo", payload, socket) do
27+
todo = TodoTest.Todos.create_todo(payload)
2728
broadcast socket, "ok", payload
2829
{:noreply, socket}
2930
end

0 commit comments

Comments
 (0)