mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-13 01:00:12 +00:00
Rework API
This commit is contained in:
parent
ac911b170d
commit
47187138b6
5 changed files with 183 additions and 175 deletions
|
|
@ -21,8 +21,8 @@ class Switch(namedtuple("Switch", ["id", "system", "timestamp", "members"])):
|
|||
async def move(self, conn, new_timestamp):
|
||||
await db.move_switch(conn, self.system, self.id, new_timestamp)
|
||||
|
||||
async def to_json(self, conn):
|
||||
async def to_json(self, hid_getter):
|
||||
return {
|
||||
"timestamp": self.timestamp.isoformat(),
|
||||
"members": [member.hid for member in await self.fetch_members(conn)]
|
||||
"members": [await hid_getter(m) for m in self.members]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue