diff --git a/apps/dgiot_device/src/dgiot_device_channel.erl b/apps/dgiot_device/src/dgiot_device_channel.erl index 4f3b44bb..0f65572d 100644 --- a/apps/dgiot_device/src/dgiot_device_channel.erl +++ b/apps/dgiot_device/src/dgiot_device_channel.erl @@ -170,7 +170,7 @@ handle_message({sync_parse, _Pid, 'after', put, _Token, <<"Device">>, QueryData} handle_message({sync_parse, _Pid, 'after', delete, _Token, <<"Device">>, ObjectId}, State) -> %% io:format("~s ~p ~p ~p ~n", [?FILE, ?LINE, Pid, ObjectId]), - dgiot_device:delete('after', ObjectId), + dgiot_device_hook:delete('after', ObjectId), {ok, State}; handle_message({sync_parse, Pid, 'after', get, Token, <<"Product">>, #{<<"results">> := _Results} = ResBody}, State) -> diff --git a/apps/dgiot_device/src/dgiot_device_hook.erl b/apps/dgiot_device/src/dgiot_device_hook.erl index 3c4c82fb..1a146c08 100644 --- a/apps/dgiot_device/src/dgiot_device_hook.erl +++ b/apps/dgiot_device/src/dgiot_device_hook.erl @@ -34,6 +34,7 @@ put(_, _) -> pass. delete('after', DeviceId) -> + dgiot_device:delete(DeviceId), case dgiot_parse:query_object(<<"Dict">>, #{<<"where">> => #{<<"key">> => DeviceId, <<"class">> => <<"Device">>}}) of {ok, #{<<"results">> := Dicts}} -> DictRequests = @@ -63,6 +64,7 @@ delete('after', DeviceId) -> pass end; + delete(_, _) -> pass.