src/server/storage/metadatastorage.js
function updateProjectHooks(projectId, hooks, callback) {
        return self.projectCollection.findOne({_id: projectId})
            .then(function (projectData) {
                if (!projectData) {
                    throw new Error('no such project [' + projectId + ']');
                }

                // always update webhook information as a whole to allow remove and create and update as well
                projectData.hooks = hooks;

                return self.projectCollection.updateOne({_id: projectId}, projectData, {upsert: true});
            })
            .then(function () {
                return getProject(projectId);
            })
            .nodeify(callback);
    }
function updateProjectHooks(projectId, hooks, callback) {
        return self.projectCollection.findOne({_id: projectId})
            .then(function (projectData) {
                if (!projectData) {
                    throw new Error('no such project [' + projectId + ']');
                }

                // always update webhook information as a whole to allow remove and create and update as well
                projectData.hooks = hooks;

                return self.projectCollection.updateOne({_id: projectId}, projectData, {upsert: true});
            })
            .then(function () {
                return getProject(projectId);
            })
            .nodeify(callback);
    }
function updateProjectHooks ( projectId , hooks , callback ) { return self . projectCollection . findOne ( { _id : projectId } ) . then ( function ( projectData ) { if ( ! projectData ) { throw new Error ( 'no such project [' + projectId + ']' ) ; } // always update webhook information as a whole to allow remove and create and update as well projectData . hooks = hooks ; return self . projectCollection . updateOne ( { _id : projectId } , projectData , { upsert : true } ) ; } ) . then ( function ( ) { return getProject ( projectId ) ; } ) . nodeify ( callback ) ; }
This method isn't safe and should only be used privately or for removing all hooks.
@param projectId
@param hooks
@param callback
@returns {*}
This method isn t safe and should only be used privately or for removing all hooks .