Skip to content

Commit 05aa5c6

Browse files
committed
Don't parse preferences to record type before returning them
1 parent 51793f2 commit 05aa5c6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
open Lexicons.App.Bsky.Actor.Defs
2-
open Lexicons.App.Bsky.Actor.GetPreferences.Main
3-
41
let handler =
52
Xrpc.handler ~auth:Authorization (fun {db; auth; _} ->
63
let did = Auth.get_authed_did_exn auth in
@@ -11,6 +8,7 @@ let handler =
118
| None ->
129
Errors.internal_error ()
1310
in
14-
preferences |> preferences_of_yojson |> Result.get_ok
15-
|> (fun p -> {preferences= p})
16-
|> output_to_yojson |> Yojson.Safe.to_string |> Dream.json )
11+
(* skip yojson roundtrip because that would strip extra properties *)
12+
Dream.json
13+
@@ Format.sprintf {|{ "preferences": %s }|}
14+
(Yojson.Safe.to_string preferences) )

0 commit comments

Comments
 (0)