'use strict'

// let logger = require('tracer').colorConsole()
let registry = require('../../extensions/registry')
let basic = require('./basic-response-helper')

module.exports = {

  setStageConfig: function setStageConfig(req, res) {
    basic.insertRespond(req, res, 'pipeline_stage_configs')
  },

  deleteStageConfig: function setStageConfig(req, res) {
    basic.deleteRespond(req, res, 'pipeline_stage_configs')
  },

  getAvailableTypes: function getAvailableTypes(req, res) {
    res.status(201).send({data: registry.getStageTypes()})
  },

  /**
   * Get stages for a specific pipeline
   *
   * @param req
   * @param res
   */
  getListForPipeline: function getListForPipeline(req, res) {

    basic.getListCustom(req, res, 'pipeline_stage_configs', query => {
      return query.where('pipeline_config_id', req.params.id)
    })

  }

}

@@ -296,16 +296,141 @@
 )%0A  %7D,%0A%0A
+  updateStageConfig: function updateStageConfig(req, res) %7B%0A    basic.patchRespond(req, res, 'pipeline_stage_configs')%0A  %7D,%0A%0A
   delete
@@ -443,35 +443,38 @@
 onfig: function 
-s
+del
 et
+e
 StageConfig(req,

Add controller to handle patching stage configs