How to use the forest-express.init function in forest-express

To help you get started, we’ve selected a few forest-express examples, based on popular ways it is used in public projects.

github ForestAdmin / forest-express-sequelize / src / index.js View on Github external
return resolve();
      }),
  };

  exports.Mixpanel = {
    getUser: (userModel, userId) => {
      if (userId) {
        return orm.findRecord(userModel, userId)
          .then((user) => user.toJSON());
      }

      return P.resolve();
    },
  };

  return Interface.init(exports);
};
github ForestAdmin / forest-express-mongoose / src / index.js View on Github external
return customerModel
            .findById(customerId)
            .lean()
            .exec((err, customer) => {
              if (err) { return reject(err); }
              if (!customer || !customer[customerField]) { return reject(); }

              return resolve(customer);
            });
        }
        return resolve();
      });
    },
  };

  return Interface.init(exports);
};