@@ -31,6 +31,10 @@ class TodosController {
$todo = $todos[$id]
? ['todo' => $todos[$id]]
: NULL;
+ if ($todo) {
+ $todo['todo']['desc'] = $todo['todo']['description'];
+ unset($todo['todo']['description']);
+ }
return $app->json($todo);
}
@@ -12,7 +12,10 @@ const TodoItem = Backbone.Model.extend({
// Long format for arrow function to allow breakpoint setting in Chrome.
parse: (response) => {
- return response.todo;
+ const todo = response.todo;
+ todo.desc = todo.description;
+ delete todo.description;
+ return todo;
},
toggleStatus(view) {
@@ -1,7 +1,7 @@
{
"1": {
"id": 1,
- "description": "some description",
+ "description": "some other description",
"status": "incomplete"
"2": {