mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	settings: Fix re-ordering folders when there is an archived folder.
This commit updates webapp code to include archived folder IDs as well in the "order" list passed when re-ordering folders. Also, updated API documentation to mention that archived folder IDs should also be included.
This commit is contained in:
		@@ -22,6 +22,13 @@ function update_folder_order(this: HTMLElement): void {
 | 
			
		||||
    $(".channel-folder-row").each(function () {
 | 
			
		||||
        order.push(Number.parseInt($(this).attr("data-channel-folder-id")!, 10));
 | 
			
		||||
    });
 | 
			
		||||
    const archived_folders = channel_folders
 | 
			
		||||
        .get_channel_folders(true)
 | 
			
		||||
        .filter((folder) => folder.is_archived)
 | 
			
		||||
        .sort((a, b) => util.strcmp(a.name.toLowerCase(), b.name.toLowerCase()));
 | 
			
		||||
    for (const folder of archived_folders) {
 | 
			
		||||
        order.push(folder.id);
 | 
			
		||||
    }
 | 
			
		||||
    settings_ui.do_settings_change(
 | 
			
		||||
        channel.patch,
 | 
			
		||||
        "/json/channel_folders",
 | 
			
		||||
 
 | 
			
		||||
@@ -24554,6 +24554,10 @@ paths:
 | 
			
		||||
                  type: array
 | 
			
		||||
                  description: |
 | 
			
		||||
                    A list of channel folder IDs representing the new order.
 | 
			
		||||
 | 
			
		||||
                    This list must include the IDs of all the
 | 
			
		||||
                    organization's channel folders, including archived
 | 
			
		||||
                    folders.
 | 
			
		||||
                  items:
 | 
			
		||||
                    type: integer
 | 
			
		||||
            encoding:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user