make two custom columns sortables

I have 2 custom columns, typeconsole and console:

add_filter('manage_edit-post_sortable_columns', function( $columns ) { 
        $columns['typeconsole'] = 'typeconsole';
        $columns['console'] = 'console';
        return $columns;
});

This answer allows me to sort the first column: Make custom column sortable. When pressing the second column, the first one is ordered.

How do I make them work independently?

Topic columns sort Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.