From 04deed8e233a7350e3ba16e5aaaa36f32a012adc Mon Sep 17 00:00:00 2001 From: LV-426 Date: Fri, 22 May 2015 01:34:55 +0300 Subject: rz_api_backend.js: rzdoc_search --- src/client/rz_api_backend.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') 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); } } -- cgit v1.3.1