diff options
Diffstat (limited to 'web/src/js/flow')
-rw-r--r-- | web/src/js/flow/utils.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/web/src/js/flow/utils.js b/web/src/js/flow/utils.js index dd7f763b..a67db94f 100644 --- a/web/src/js/flow/utils.js +++ b/web/src/js/flow/utils.js @@ -1,4 +1,5 @@ var _ = require("lodash"); +var $ = require("jquery"); var MessageUtils = { getContentType: function (message) { @@ -34,6 +35,18 @@ var MessageUtils = { } } return false; + }, + getContentURL: function(flow, message){ + if(message === flow.request){ + message = "request"; + } else if (message === flow.response){ + message = "response"; + } + return "/flows/" + flow.id + "/" + message + "/content"; + }, + getContent: function(flow, message){ + var url = MessageUtils.getContentURL(flow, message); + return $.get(url); } }; |