gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant-frontends] branch master updated: fix /trac


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant-frontends] branch master updated: fix /track methods + minor optimization to backoffice JS
Date: Thu, 13 Jul 2017 14:30:42 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository merchant-frontends.

The following commit(s) were added to refs/heads/master by this push:
     new 7174a23  fix /track methods + minor optimization to backoffice JS
7174a23 is described below

commit 7174a23f96e92df69932fd050c36393b325ba9a6
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Jul 13 14:30:02 2017 +0200

    fix /track methods + minor optimization to backoffice JS
---
 talerfrontends/blog/blog.py              |  2 ++
 talerfrontends/blog/static/backoffice.js | 17 ++++++++---------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/talerfrontends/blog/blog.py b/talerfrontends/blog/blog.py
index 452176a..2819267 100644
--- a/talerfrontends/blog/blog.py
+++ b/talerfrontends/blog/blog.py
@@ -225,6 +225,7 @@ def track_transfer():
     r = requests.get(url, params=dict(parse_qsl(qs)))
     if 200 != r.status_code:
         return backend_error(r)
+    return flask.jsonify(r.json()), r.status_code
 
 
 @app.route("/track/order")
@@ -234,3 +235,4 @@ def track_order():
     r = requests.get(url, params=dict(parse_qsl(qs)))
     if 200 != r.status_code:
         return backend_error(r)
+    return flask.jsonify(r.json()), r.status_code
diff --git a/talerfrontends/blog/static/backoffice.js 
b/talerfrontends/blog/static/backoffice.js
index f506283..3f3ffbc 100644
--- a/talerfrontends/blog/static/backoffice.js
+++ b/talerfrontends/blog/static/backoffice.js
@@ -111,7 +111,8 @@ function track_transfer(exchange, wtid){
   req.open("GET", qs, true);
   req.onload = function(){
     if(4 == req.readyState){
-      if(200 == req.status){
+      switch(req.status){
+      case 200:
         var tracks = JSON.parse(req.responseText);
         var table = document.getElementById("history");
         var tbody = xpath_get("tbody", table).snapshotItem(0);
@@ -119,16 +120,14 @@ function track_transfer(exchange, wtid){
         for(var i=0; i<tbody_children.snapshotLength; i++){
           tbody.removeChild(tbody_children.snapshotItem(i));
         }
+        // FIXME: table now shown!
         fill_table(tracks.deposits_sums, tracks.execution_time);
-        close_popup();
-      }
-      if(400 == req.status){
-        alert("Bad request, check submitted data!");
-        return; 
-      }
-      else{
+        break;
+      case 400:
+        console.log("Bad request, check submitted data!");
+        break;
+      default:
         console.log(`Status: ${req.status}, not handled.`);
-        return;
       }
     }
   }

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]