Browse Source

ui start 2.5.51

main
gsd 4 months ago
parent
commit
a63fe19775
  1. 12
      webExtensions/messageList.py

12
webExtensions/messageList.py

@ -19,11 +19,15 @@ class WebExtension:
@self.app.get(f"{self.core.context}/messages")
@self.core.authManager.authRequest()
async def listOfMessages(request: Request, limit: int = Query(10), offset: int = Query(0)):
async def listOfMessages(request: Request, limit: int = Query(10), offset: int = Query(0), after: int = Query(0)):
collection = self.dbStore['packet']
c = collection.find({
payload = {
"to": int(self.core.PUB_CH),
"portnum":self.MESSAGE_PORTNUM
}).sort("ts", DESCENDING).skip(offset).limit(limit)
"portnum":self.MESSAGE_PORTNUM,
"ts":{'$gt': after}
}
c = collection.find(payload).sort("ts", DESCENDING).skip(offset).limit(limit)
l = await c.to_list()
return [MessageDTO(msg) for msg in l]
Loading…
Cancel
Save