refactoring listing bundles on server

This commit is contained in:
George Shaw 2017-11-30 16:16:17 -06:00
parent 32d0876aae
commit 5aba3b60dd
3 changed files with 4 additions and 7 deletions

View file

@ -17,7 +17,6 @@ func List(res http.ResponseWriter, req *http.Request, logger *log.Logger, bundle
}
if len(bundles) <= 0 {
logger.Println("no bundles :: http response returns no content")
res.WriteHeader(http.StatusNoContent)
return true
}

View file

@ -19,10 +19,9 @@ jQuery('._js_bundles-manage').on('click', function(e){
else {
manageBundlesModal.find('.modal-body').html("An error has occurred. Please try again. If problem persists contact server administrator.")
}
manageBundlesModal.modal('show');
}
else if(xhr.status == 204) {
manageBundlesModal.modal('show');
manageBundlesModal.find('.modal-body').html("<p>No bundles current exist on the server.</p>")
}
else {
if(xhr.response != undefined && xhr.response.length != 0) {
@ -31,7 +30,8 @@ jQuery('._js_bundles-manage').on('click', function(e){
else {
manageBundlesModal.find('.modal-body').html(xhr.status + " Error!")
}
manageBundlesModal.modal('show');
}
}
manageBundlesModal.modal('show');
});

View file

@ -74,9 +74,7 @@
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p>No bundles current exist on the server.</p>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>