Make %(ApiResponse)
a proc as conversion of wrapped types can have side-effects.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "0.4.9"
|
version = "0.4.10"
|
||||||
author = "Jonathan Bernard"
|
author = "Jonathan Bernard"
|
||||||
description = "Jonathan's opinionated extensions and auth layer for Jester."
|
description = "Jonathan's opinionated extensions and auth layer for Jester."
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
@@ -31,7 +31,7 @@ func initApiResponse*[T](
|
|||||||
totalItems: totalItems, nextLink: nextLink, prevLink: prevLink)
|
totalItems: totalItems, nextLink: nextLink, prevLink: prevLink)
|
||||||
|
|
||||||
|
|
||||||
func `%`*(r: ApiResponse): JsonNode =
|
proc `%`*(r: ApiResponse): JsonNode =
|
||||||
result = newJObject()
|
result = newJObject()
|
||||||
if r.details.isSome: result["details"] = %r.details
|
if r.details.isSome: result["details"] = %r.details
|
||||||
if r.data.isSome: result["data"] = %r.data
|
if r.data.isSome: result["data"] = %r.data
|
||||||
|
Reference in New Issue
Block a user