Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fh-forms

Package Overview
Dependencies
Maintainers
1
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fh-forms - npm Package Compare versions

Comparing version 0.5.12 to 0.5.13

10

lib/forms.js

@@ -12,2 +12,3 @@ var mongoose = require('mongoose');

var logWrapper = require('./common/logWrapper');
var deleteAppReferences = require('./impl/deleteAppRefrences.js');

@@ -550,4 +551,7 @@ var forms = {

deleteAppRefrences: function (options, params, cb) {
console.log("called delete app refrences ");
cb();
var self = this;
self.initConnection(options, function(err, connections) {
if(err) return cb(err);
return deleteAppReferences.deleteAppRefrences(connections, options, params, cb);
});
},

@@ -566,4 +570,4 @@

logWrapper.addLoggingToFunctions(forms, "forms.", ["setLogger"]);
logWrapper.addLoggingToFunctions(forms, "forms.", ["deleteAppRefrences", "setLogger"]);
module.exports = forms;

@@ -8,3 +8,2 @@ var models = require('../common/models.js')();

module.exports = function () {
logger.debug("returning appConfig");
return {

@@ -11,0 +10,0 @@ updateAppConfig: updateAppConfig,

@@ -7,4 +7,50 @@ var util = require('util');

module.exports = function (connections, options, cb) {
module.exports = function () {
return {
deleteAppRefrences: function (connections, options, params, cb) {
};
async.series([validateParams, validateGroupAccessToForm, deleteAppForms], cb);
function validateParams(cb){
var paramsValidator = validate(params);
paramsValidator.has("appId", function(failure){
if(failure){
return cb(new Error("Invalid params to deleteAppReferences. No AppId specified."));
} else {
return cb();
}
});
}
function validateGroupAccessToForm(cb) {
return groups.validateAppAllowedForUser(connections, options.restrictToUser, params.appId, cb);
}
// updates to AppForms sub collection
function deleteAppForms(cb) {
var appId = params.appId;
async.series([
function (cb) { // first remove the form itself
var appFormsModel = models.get(connections.mongooseConnection, models.MODELNAMES.APP_FORMS);
appFormsModel.find({appId: appId}).remove().exec(cb);
},
function (cb) { // remove deleted from from any groups
groups.removeAppFromAllGroups(connections, appId, cb);
},
function deleteThemeRefrences (cb){
var appThemeModel = models.get(connections.mongooseConnection, models.MODELNAMES.APP_THEMES);
appThemeModel.find({"appId":appId}).remove().exec(cb);
}
// ,
// function (cb) { // remove submissions
// deleteSubmissions(formId, cb);
// }
], function (err) {
if (err) return cb(err);
return cb(null);
});
}
}
};
}();
{
"name": "fh-forms",
"version": "0.5.12",
"version": "0.5.13",
"description": "Cloud Forms API for form submission",

@@ -5,0 +5,0 @@ "main": "lib/forms.js",

@@ -1,1 +0,1 @@

0.5.12-46
0.5.13-47
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc