From 5c94dcd211d17c701b210bc84c97933462907bdb Mon Sep 17 00:00:00 2001 From: baarkerlounger <5101747+baarkerlounger@users.noreply.github.com> Date: Thu, 10 Mar 2022 11:15:14 +0000 Subject: [PATCH] Lookup org id for API requests (#368) --- app/controllers/case_logs_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/case_logs_controller.rb b/app/controllers/case_logs_controller.rb index 1b016473c..f635826bc 100644 --- a/app/controllers/case_logs_controller.rb +++ b/app/controllers/case_logs_controller.rb @@ -99,7 +99,10 @@ private def api_case_log_params return {} unless params[:case_log] - params.require(:case_log).permit(CaseLog.editable_fields) + permitted = params.require(:case_log).permit(CaseLog.editable_fields) + permitted["owning_organisation"] = Organisation.find_by(permitted["owning_organisation"]) + permitted["managing_organisation"] = Organisation.find_by(permitted["managing_organisation"]) + permitted end def find_resource