diff --git a/dbService.py b/dbService.py index 6aa121d..146018e 100644 --- a/dbService.py +++ b/dbService.py @@ -47,7 +47,7 @@ class DbService: async def oneNode(self, num: int): collection = self.dbStore['node_info'] c = await collection.find_one( - {"num":num}, + {"num":int(num)}, sort=[("ts", -1)] ) return c diff --git a/webExtensions/publicEndpoints.py b/webExtensions/publicEndpoints.py index 388d302..2b69b0c 100644 --- a/webExtensions/publicEndpoints.py +++ b/webExtensions/publicEndpoints.py @@ -56,7 +56,7 @@ class WebExtension: async def userNode(request:Request): userNum = request.cookies.get(self.core.authManager.NUM, None) userNode = await self.dbService.oneNode(userNum) - if userNum: + if userNum is not None: return NodeDTO(userNode) else: return {} \ No newline at end of file