updateMarkedItem.js

/**
 * Created by WORKER on 23-10-2015.
 */
var async = require('async')
var getMarkedItems = require('./getMarkedItems')

/**
 * Build list of habits.
 * @param  {Object} options Input parameters
 */
function updateMarkedItem(options) {
  var modifiedAt = Date.now()
  var data = {
    list: []
  }
  var items = []
  console.log('Creating marked item: ' + options.data.name)

  if (options.data.name) {
    options.DB.MarkClln.update(
      { name: options.data.name },
      { $set: { mark: options.data.mark, modifiedAt: modifiedAt } },
      function (err) {
        console.log('Updated item in MarkClln')
        getMarkedItems(options)
      }
    )
  }
}

module.exports = updateMarkedItem