Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
Better snapshot importing #62
Browse files Browse the repository at this point in the history
  • Loading branch information
pantsel committed May 12, 2017
1 parent eb454b6 commit 1b4500e
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 165 deletions.
2 changes: 0 additions & 2 deletions api/controllers/SnapshotController.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ module.exports = _.merge(_.cloneDeep(require('../base/Controller')), {
fns.push(function(cb){
KongService.createFromEndpointCb("/" + key,item,function(err,created){

console.log("######################",item);

if(!responseData[key]) {
responseData[key] = {
imported : 0,
Expand Down
12 changes: 4 additions & 8 deletions api/services/KongService.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,13 @@ var KongService = {

createFromEndpointCb: function (endpoint,data, cb) {

if(data.config) {
Object.keys(data.config).forEach(function(key){
data["config." + key] = data.config[key]
})

delete data.config
}

unirest.post(sails.config.kong_admin_url + endpoint)
.header('Content-Type', 'application/json')
.send(data)
.end(function (response) {
//if(data.name == "request-transformer") {
// console.log(response.error)
//}
if (response.error) return cb(response)
return cb(null,response.body)
})
Expand Down
1 change: 0 additions & 1 deletion assets/js/app/settings/snapshots/snapshot-apply-modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ <h5>Applying snapshot to "{{user.node.name}}". Please wait...</h5>
<br>
<p class="help-block">{{value.failed.items.join(", ")}}</p>


</td>
</tr>
</table>
Expand Down
Loading

0 comments on commit 1b4500e

Please sign in to comment.