fcf.module({
  name: "fcfDBControls:templates/management.receive.js",
  dependencies: [],
  module: function(){
    var self = this;
    return {
      receive: function(a_fields, a_files, a_request){
        if (a_fields.action == "remove" && a_fields.id && a_fields.projection ) {
          return fcf.application.getStorage().query(
            {
              type: "DELETE",
              from: a_fields.projection,
              where: [{type: "=", args:[{function: "key"}, {value: a_fields.id}]}],
            },
          );
        } else {
          return "ok";
        }
      }
    }
  }
});
