channel_folders: Add support to update channel folders.

Fixes part of #31972.
This commit is contained in:
Sahil Batra
2025-05-07 19:21:08 +05:30
committed by Tim Abbott
parent e93667cc06
commit 5de0f265bd
14 changed files with 534 additions and 6 deletions

View File

@@ -63,3 +63,11 @@ def get_channel_folders_in_realm(
channel_folders = [get_channel_folder_dict(channel_folder) for channel_folder in folders]
return sorted(channel_folders, key=lambda folder: folder["id"])
def get_channel_folder_by_id(channel_folder_id: int, realm: Realm) -> ChannelFolder:
try:
channel_folder = ChannelFolder.objects.get(id=channel_folder_id, realm=realm)
return channel_folder
except ChannelFolder.DoesNotExist:
raise JsonableError(_("Invalid channel folder ID"))