'use strict';

import DeepFramework from 'deep-framework';

export default class Handler extends DeepFramework.Core.AWS.Lambda.Runtime {

  /**
   * @param {Array} args
   */
  constructor(...args) {
    super(...args);
  }

  handle(request) {
    let Todo = this._kernel.get('db').get('Todo');

    if (!request.data.Id || typeof request.data.Id !== 'string') {
      throw new InvalidArgumentException(request.data.Id, 'string');
    }

    Todo.updateItem(request.data.Id, request.data, (err, todo) => {
      if (err) {
        throw new DatabaseOperationException(err);
      }

      return this.createResponse(todo.get()).send();
    });
  }
}

@@ -218,16 +218,48 @@
 );%0A  %7D%0A%0A
+  /**%0A   * @param request%0A   */%0A
   handle
@@ -282,100 +282,61 @@
 let 
-T
+t
 odo
+Id
  = 
-this._kernel.get('db').get('Todo');%0A%0A    if (!request.data.Id %7C%7C typeof request.data.
+request.getParam('Id');%0A%0A    if (typeof todo
 Id !
@@ -391,29 +391,20 @@
 ception(
-request.data.
+todo
 Id, 'str
@@ -425,37 +425,89 @@
     
-Todo.updateItem(request.data.
+let TodoModel = this.kernel.get('db').get('Todo');%0A%0A    TodoModel.updateItem(todo
 Id, 
@@ -572,16 +572,45 @@
 row new 
+DeepFramework.Core.Exception.
 Database

Update improve codebase