[UNSTABLE] expected params to be a map with atoms or string keys, got a map with mixed keys

pull/1200/head
Rick Carlino 2020-05-11 11:34:40 -05:00
parent 049411f272
commit 717a0d7544
1 changed files with 8 additions and 2 deletions

View File

@ -13,8 +13,10 @@ defmodule FarmbotCeleryScript.Compiler.UpdateResource do
label = Map.fetch!(args, :label)
resource = Map.fetch!(better_params, label)
me.do_update(resource, update)
%AST{kind: :point} -> me.do_update(variable.args, update)
%AST{kind: :resource} -> me.do_update(variable.args, update)
%AST{kind: :point} ->
me.do_update(variable.args, update)
%AST{kind: :resource} ->
me.do_update(variable.args, update)
res -> raise "Resource error. Please notfiy support: #{inspect(res)}"
end
end
@ -28,6 +30,10 @@ defmodule FarmbotCeleryScript.Compiler.UpdateResource do
FarmbotCeleryScript.SysCalls.update_resource(kind, id, update_params)
end
def do_update(%{args: %{pointer_id: id, pointer_type: k}}, update_params) do
FarmbotCeleryScript.SysCalls.update_resource(k, id, update_params)
end
def do_update(other, update) do
raise String.trim("""
MARK AS can only be used to mark resources like plants and devices.