Skip to content

Commit

Permalink
Fix invalid user search errors again
Browse files Browse the repository at this point in the history
  • Loading branch information
zedeus committed Apr 21, 2023
1 parent 376b444 commit 92b3ca2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/experimental/parser/user.nim
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ proc parseUser*(json: string; username=""): User =
proc parseUsers*(json: string; after=""): Result[User] =
result = Result[User](beginning: after.len == 0)

let raw = json.fromJson(seq[RawUser])
for user in raw:
result.content.add user.toUser
# starting with '{' means it's an error
if json[0] == '[':
let raw = json.fromJson(seq[RawUser])
for user in raw:
result.content.add user.toUser

0 comments on commit 92b3ca2

Please sign in to comment.