mirror of
https://gitee.com/dgiiot/dgiot.git
synced 2024-12-02 12:18:30 +08:00
fix: delete devcie failed
This commit is contained in:
parent
241091e5e1
commit
df832a26de
@ -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) ->
|
||||
|
@ -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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user