Pass station json direct to frontend

This commit is contained in:
ronreg-ribdev 2020-05-24 02:02:12 -07:00
parent 42da0d9ee3
commit f363f38275

View File

@ -94,10 +94,11 @@
~& "on-arvo wire: {<wire>}"
?: ?=(%http-response +<.sign-arvo)
=/ http-moves=(list card)
=/ value %- pairs:enjs:format
:~ fulltext+s+(crip "{<sign-arvo>}")
==
?+ wire ~
[%bartstationrequest *]
=/ value=json (parse-request-stations-response:cc client-response.sign-arvo)
[%give %fact ~[/primary] %json !>(value)]~
==
[http-moves this]
?. ?=(%bound +<.sign-arvo)
(on-arvo:def wire sign-arvo)
@ -123,6 +124,19 @@
=/ headers [['Accept' 'application/json']]~
[%'GET' url headers *(unit octs)]
::
++ parse-request-stations-response
|= response=client-response:iris
^- json
=/ pairs pairs:enjs:format
?. ?=(%finished -.response)
%- pairs [fulltext+s+'bart response error' ~]
=/ data=(unit mime-data:iris) full-file.response
?~ data %- pairs ~
=/ ujon=(unit json) (de-json:html q.data.u.data)
?~ ujon %- pairs ~
=/ parsed-json u.ujon
parsed-json
::
++ poke-handle-http-request
|= =inbound-request:eyre
^- simple-payload:http