feat(backend): policy rules show what they inherit, files of a chat or folder go to trash in one batch, trash list is paged
This commit is contained in:
1 parent
945adcf879
commit
f646f29ff9
9 files changed
+389
-15
No files matched your search
@@ -176,6 +176,18 @@ async def list_chats(
|
||||
return [_chat_item(row) for row in rows]
|
||||
|
||||
|
||||
async def folder_chat_ids(
|
||||
pool: asyncpg.Pool, account_id: int, folder: FolderSpec
|
||||
) -> list[int]:
|
||||
rows_sql = _CHAT_ROWS.format(ids=_ALL_IDS)
|
||||
rows = await pool.fetch(
|
||||
f"SELECT chat.chat_id FROM ({rows_sql}) chat WHERE {_folder_filter(1)}", # noqa: S608
|
||||
account_id,
|
||||
*_folder_params(folder),
|
||||
)
|
||||
return [row["chat_id"] for row in rows]
|
||||
|
||||
|
||||
async def get_chat(
|
||||
pool: asyncpg.Pool, account_id: int, chat_id: int
|
||||
) -> ChatListItem | None:
|
||||
|
||||
Reference in new issue
Block a user