From 279a44d76016f9b5abf2b856cea72817f2203254 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Tue, 21 Nov 2017 15:49:16 -0800 Subject: [PATCH] fixed link in client get requests --- views/partials/asset.handlebars | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/views/partials/asset.handlebars b/views/partials/asset.handlebars index 3229996d..9fb574a8 100644 --- a/views/partials/asset.handlebars +++ b/views/partials/asset.handlebars @@ -46,20 +46,25 @@ const failureMessage = document.getElementById('failure-message'); searchMessage.hidden = true; failureMessage.hidden = false; - failureMessage.innerText(msg); + failureMessage.innerText = msg; }, checkClaimAvailability: function (claimName, claimId) { console.log(`getting ${claimName}#${claimId}}`) - var uri = `/api/get/${claimName}/${claimId}`; + var uri = `/api/local/${claimName}/${claimId}`; var xhr = new XMLHttpRequest(); var that = this; xhr.open("GET", uri, true); xhr.onreadystatechange = function() { if (xhr.readyState == 4) { const response = JSON.parse(xhr.response); - if (xhr.status == 200 && response.message === false) { - that.showSearchMessage(); - that.getAsset(claimName, claimId) + if (xhr.status == 200) { + if (response.message === false) { + that.showSearchMessage(); + that.getAsset(claimName, claimId) + } else { + console.log('local asset is available on spee.ch') + that.showAsset(); + } } else { console.log('get failed:', response); that.showFailureMessage('Well this sucks, but we can\'t seem to phone home');