Skip to content

Commit

Permalink
Correctly specify the headers passed
Browse files Browse the repository at this point in the history
prior method wasn’t correct jquery way
  • Loading branch information
quadrophobiac committed Aug 23, 2017
1 parent 6371516 commit a9501d8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions views/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,22 @@
slug = $input.val()
if (slug.length > 0) {
$.ajax({
url: 'https://api.heroku.com/apps/'+slug,
headers: 'application/vnd.heroku+json; version=3'
url: 'https://api.heroku.com/apps/' + slug,
headers: {
'Accept': 'application/vnd.heroku+json; version=3'
}
})
.always(function(data, textStatus) {
if (data.status == 404) {
console.log(slug)
console.log(JSON.stringify(data, null, 4))
$input.parent('div').removeClass('has-danger')
$input.parent('div').addClass('has-success')
$input.removeClass('form-control-danger')
$input.addClass('form-control-success')
$input.parent('div').find('.form-control-feedback').html("Your Bothan instance will be hosted at https://" + slug + ".herokuapp.com")
$('#submit').attr('disabled', false)
} else {
console.log(slug);
console.log(JSON.stringify(data, null, 4))
$input.parent('div').removeClass('has-success')
$input.parent('div').addClass('has-danger')
$input.removeClass('form-control-success')
Expand Down

0 comments on commit a9501d8

Please sign in to comment.