'use strict'

const AWS = require('aws-sdk')
const uuid = require('uuid')

const config = require('../config.json')
const encryption = require('./encryption')

module.exports.put = function (data, callback) {
  let docClient = new AWS.DynamoDB.DocumentClient()
  let payload = {
    id: uuid.v4(),
    data: encryption.encrypt(data)
  }
  return docClient.put({TableName: config.TABLE_NAME, Item: payload}, (error) => callback(error))
}

@@ -430,8 +430,258 @@
 ror))%0A%7D%0A
+%0Amodule.exports.delete = function (id, callback) %7B%0A  let docClient = new AWS.DynamoDB.DocumentClient()%0A  let deleteRequest = %7B%0A    TableName: config.TABLE_NAME,%0A    Key: %7Bid%7D%0A  %7D%0A  return docClient.delete(deleteRequest, (error) =%3E callback(error))%0A%7D%0A

add database delete function