Only parse user search if it's a list

This commit is contained in:
Zed 2023-04-21 04:08:06 +02:00
parent 5dd85c63d7
commit c8e8ea3ada
1 changed files with 4 additions and 3 deletions

View File

@ -80,6 +80,7 @@ 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
if json[0] == '[':
let raw = json.fromJson(seq[RawUser])
for user in raw:
result.content.add user.toUser