How to use the rest-hapi.deleteOne function in rest-hapi

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

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JKHeadley / appy-backend / server / api / user.api.js View on Github external
const deleteCurrentUserHandler = async function(request, h) {
      try {
        const _id = request.auth.credentials.user._id

        return await RestHapi.deleteOne(User, _id, {}, Log)
      } catch (err) {
        errorHelper.handleError(err, Log)
      }
    }
github JKHeadley / appy-backend / backend / server / api / user.js View on Github external
const deleteCurrentUserHandler = function (request, reply) {

      const _id = request.auth.credentials.user._id;

      return RestHapi.deleteOne(User, _id, {}, Log)
        .then(function (user) {
          return reply(user);
        })
        .catch(function (error) {
          Log.error(error);
          return reply(RestHapi.errorHelper.formatResponse(error));
        });
    };
github JKHeadley / appy-backend / server / api / user.js View on Github external
const deleteCurrentUserHandler = function (request, reply) {

      const _id = request.auth.credentials.user._id;

      return RestHapi.deleteOne(User, _id, {}, Log)
        .then(function (user) {
          return reply(user);
        })
        .catch(function (error) {
          Log.error(error);
          return reply(RestHapi.errorHelper.formatResponse(error));
        });
    };