Skip to content

Commit

Permalink
contacts: handle null value in $action %edit
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolajpp committed Oct 30, 2024
1 parent 430d56d commit d83e090
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions desk/lib/contacts/json-1.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@
++ value
^- $-(json value:c)
|= jon=json
:: XX is there a way to do it in one go?
::
?~ jon ~
=/ [type=@tas val=json]
%. jon
(ot type+(se %tas) value+json ~)
Expand Down
5 changes: 5 additions & 0 deletions desk/tests/lib/contacts-json-1.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@
==
++ test-value
;: weld
:: submit null value to delete entry in contacts
::
%^ dejs-equal value:dejs:j
'null'
~
::
%+ enjs-equal
(value:enjs:j text+'the lazy fox')
Expand Down

0 comments on commit d83e090

Please sign in to comment.