diff options
| author | LV-426 <lv-426@taproot.org.il> | 2015-05-22 01:34:55 +0300 |
|---|---|---|
| committer | LV-426 <lv-426@taproot.org.il> | 2015-05-22 02:23:51 +0300 |
| commit | 04deed8e233a7350e3ba16e5aaaa36f32a012adc (patch) | |
| tree | d37cfb25bc8c3fc9a35e9edeea98f19b9080dcf1 /src/client | |
| parent | 8a1b83ae874efaf819dd19ec4564d00738b3184c (diff) | |
rz_api_backend.js: rzdoc_search
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/rz_api_backend.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/client/rz_api_backend.js b/src/client/rz_api_backend.js index 4f44031e..d8dbcc50 100644 --- a/src/client/rz_api_backend.js +++ b/src/client/rz_api_backend.js @@ -22,7 +22,7 @@ define(['util', 'model/core'], function(util, model_core) { function on_error_wrapper(xhr, text_status, err_thrown) { // log wrap callback var err_msg = xhr.responseJSON && xhr.responseJSON.error; - console.error('ajax error: status: \'' + text_status + '\' error-msg: ' + err_msg); + console.error('ajax error: status: \'' + text_status + '\', error-msg: ' + err_msg); if (on_error && typeof (on_error) === "function") { on_error(xhr, text_status, err_thrown); } @@ -243,10 +243,12 @@ define(['util', 'model/core'], function(util, model_core) { /** * list available rzdocs */ - this.rzdoc_list = function(on_success, on_error) { + this.rzdoc_search = function(search_query, on_success, on_error) { - var req_opts = { type : 'POST' }; - return ajax_rs('/api/rzdoc/list', req_opts, on_success, on_error); + var req_data = {'search_query': search_query}; + var req_opts = { type : 'POST', data : JSON.stringify(req_data)}; + + return ajax_rs('/api/rzdoc/search', req_opts, on_success, on_error); } } |
