@@ -12,51 +12,58 @@ var KongConsumerController = _.merge(_.cloneDeep(require('../base/KongControlle
1212
1313 var import_id ;
1414 if ( req . body . import_id ) {
15- import_id = req . body . import_id
15+ // import_id = req.body.import_id
1616 delete req . body . import_id
1717 }
1818 KongService . createCb ( req , res , function ( error , consumer ) {
1919 if ( error ) return res . kongError ( error )
2020
2121 // Insert created consumer to Konga
22- consumer . import_id = import_id || ''
23- consumer . node_id = req . node_id
24- sails . models . consumer . create ( consumer ) . exec ( function ( err , record ) {
25- if ( err ) return res . kongError ( err )
26- return res . json ( record )
27- } ) ;
22+ //consumer.import_id = import_id || ''
23+ //consumer.node_id = req.node_id
24+ //sails.models.consumer.create(consumer).exec(function (err, record) {
25+ // if(err) return res.kongError(err)
26+ // return res.json(record)
27+ //});
28+
29+ return res . json ( consumer )
2830 } )
2931 } ,
3032
3133 update : function ( req , res ) {
3234 KongService . updateCb ( req , res , function ( error , consumer ) {
3335 if ( error ) return res . kongError ( error )
3436
35- // Update consumer Konga consumer
36- sails . models . consumer
37- . update ( { id :req . params . id
38- } , {
39- username : consumer . username ,
40- custom_id : consumer . custom_id
41- } ) . exec ( function afterwards ( err , updated ) {
42-
43- if ( err ) return res . kongError ( err )
44- return res . json ( consumer ) ;
45- } ) ;
37+ return res . json ( consumer ) ;
38+
39+ //// Update consumer Konga consumer
40+ //sails.models.consumer
41+ // .update({id:req.params.id
42+ // },{
43+ // username: consumer.username,
44+ // custom_id : consumer.custom_id
45+ // }).exec(function afterwards(err, updated){
46+ //
47+ // if(err) return res.kongError(err)
48+ // return res.json(consumer);
49+ //});
4650 } )
4751 } ,
4852
4953 delete : function ( req , res ) {
5054 KongService . deleteCb ( req , res , function ( error , deleted ) {
5155 if ( error ) return res . kongError ( error )
52- // Delete consumer from Konga
53- sails . models . consumer . destroy ( {
54- id : req . params . id
55- } ) . exec ( function ( err ) {
56- if ( err ) return res . kongError ( err )
57- console . log ( "Destroyed consumer with id " + req . params . id )
58- return res . ok ( ) ;
59- } ) ;
56+
57+ return res . ok ( ) ;
58+
59+ //// Delete consumer from Konga
60+ //sails.models.consumer.destroy({
61+ // id: req.params.id
62+ //}).exec(function (err){
63+ // if(err) return res.kongError(err)
64+ // console.log("Destroyed consumer with id " + req.params.id)
65+ // return res.ok();
66+ //});
6067 } )
6168 } ,
6269
0 commit comments