app/controllers/naf/log_parsers_controller.rb in naf-2.1.10 vs app/controllers/naf/log_parsers_controller.rb in naf-2.1.11

- old
+ new

@@ -1,13 +1,21 @@ module Naf class LogParsersController < Naf::ApiSimpleClusterAuthenticatorApplicationController def logs if naf_cookie_valid? - response = params['logical_type'].constantize.new(params).logs - if response.present? - success = true + if params['record_id'].present? + response = params['logical_type'].constantize.new(params).logs + + if response.present? + success = true + else + success = false + end else + response = { + logs: '&nbsp;&nbsp;<span>Record id is not present</br></span>' + } success = false end render json: "convertToJsonCallback(" + { success: success }.merge(response).to_json + ")" else