Change user endpoint

This commit is contained in:
Zed
2020-06-17 00:22:11 +02:00
parent 77da2e32c6
commit 0e58c36bae
3 changed files with 5 additions and 5 deletions

View File

@@ -24,15 +24,15 @@ proc parseProfile(js: JsonNode; id=""): Profile =
result.expandProfileEntities(js)
proc parseUserShow*(js: JsonNode; username: string): Profile =
if js.isNull: return
proc parseUserLookup*(js: JsonNode; username: string): Profile =
if js.isNull or js.kind == JArray and js.len == 0: return
with error, js{"errors"}:
result = Profile(username: username)
if error.getError == suspended:
result.suspended = true
return
result = parseProfile(js)
result = parseProfile(js[0])
proc parseGraphProfile*(js: JsonNode; username: string): Profile =
if js.isNull: return