@@ -375,13 +375,12 @@ proc initDataApi(node: CodexNodeRef, repoStore: RepoStore, router: var RestRoute
375375 return RestApiResponse .response ($ json, contentType = " application/json" )
376376
377377 router.api (MethodGet , " /api/storage/v1/space" ) do () -> RestApiResponse :
378- let json =
379- % RestRepoStore (
380- totalBlocks: repoStore.totalBlocks,
381- quotaMaxBytes: repoStore.quotaMaxBytes,
382- quotaUsedBytes: repoStore.quotaUsedBytes,
383- quotaReservedBytes: repoStore.quotaReservedBytes,
384- )
378+ let json = % RestRepoStore (
379+ totalBlocks: repoStore.totalBlocks,
380+ quotaMaxBytes: repoStore.quotaMaxBytes,
381+ quotaUsedBytes: repoStore.quotaUsedBytes,
382+ quotaReservedBytes: repoStore.quotaReservedBytes,
383+ )
385384 return RestApiResponse .response ($ json, contentType = " application/json" )
386385
387386proc initNodeApi (node: CodexNodeRef , conf: CodexConf , router: var RestRouter ) =
@@ -477,20 +476,16 @@ proc initDebugApi(node: CodexNodeRef, conf: CodexConf, router: var RestRouter) =
477476 try :
478477 let table = RestRoutingTable .init (node.discovery.protocol.routingTable)
479478
480- let json =
481- %* {
482- " id" : $ node.switch.peerInfo.peerId,
483- " addrs" : node.switch.peerInfo.addrs.mapIt ($ it),
484- " repo" : $ conf.dataDir,
485- " spr" :
486- if node.discovery.dhtRecord.isSome:
487- node.discovery.dhtRecord.get.toURI
488- else :
489- " " ,
490- " announceAddresses" : node.discovery.announceAddrs,
491- " table" : table,
492- " storage" : {" version" : $ codexVersion, " revision" : $ codexRevision},
493- }
479+ let json = %* {
480+ " id" : $ node.switch.peerInfo.peerId,
481+ " addrs" : node.switch.peerInfo.addrs.mapIt ($ it),
482+ " repo" : $ conf.dataDir,
483+ " spr" :
484+ if node.discovery.dhtRecord.isSome: node.discovery.dhtRecord.get.toURI else : " " ,
485+ " announceAddresses" : node.discovery.announceAddrs,
486+ " table" : table,
487+ " storage" : {" version" : $ codexVersion, " revision" : $ codexRevision},
488+ }
494489
495490 # return pretty json for human readability
496491 return RestApiResponse .response (
0 commit comments