Skip to content

Commit

Permalink
contacts: fix $response-0 JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolajpp committed Oct 29, 2024
1 parent 984ed9e commit 430d56d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions desk/lib/contacts/json-1.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,18 @@
++ response
|= n=response:c
^- json
%+ frond -.n
?- -.n
%self (frond self+(contact con.n))
%self (frond contact+(contact con.n))
%page %- pairs
:~ kip+(kip kip.n)
con+(contact con.n)
contact+(contact con.n)
mod+(contact mod.n)
==
%wipe (frond kip+(kip kip.n))
%peer %- pairs
:~ who+(ship who.n)
con+(contact con.n)
contact+(contact con.n)
==
==
--
Expand Down
10 changes: 5 additions & 5 deletions desk/tests/lib/contacts-json-1.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
flag+[~sampel-palnet %circle]
::
%+ enjs-equal
%- value:enjs:j
%- value:enjs:j
set+(silt `(list value)`~[flag/[~sampel-palnet %circle] flag/[~sampel-pardux %square]])
'{"type":"set","value":[{"type":"flag","value":"~sampel-palnet/circle"},{"type":"flag","value":"~sampel-pardux/square"}]}'
::
Expand Down Expand Up @@ -207,7 +207,7 @@
:~ surname+text/'Palnet'
==
;: weld
%+ enjs-equal
%+ enjs-equal
(response:enjs:j [%self con])
'{"self":{"contact":{"name":{"type":"text","value":"Sampel"}}}}'
::
Expand All @@ -224,15 +224,15 @@
}
'''
::
%+ enjs-equal
%+ enjs-equal
(response:enjs:j [%wipe id+0v1])
'{"wipe":{"kip":"0v1"}}'
::
%+ enjs-equal
%+ enjs-equal
(response:enjs:j [%wipe ~sampel-palnet])
'{"wipe":{"kip":"~sampel-palnet"}}'
::
%+ enjs-equal
%+ enjs-equal
(response:enjs:j [%peer ~sampel-palnet con])
^~ %- en:json:html %- need %- de:json:html
'''
Expand Down

0 comments on commit 430d56d

Please sign in to comment.