mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-02 13:12:13 +08:00
Merge pull request #3046 from okriuchykhin/ok_SCI_5361
Add default sorting to ProjectsOverviewService [SCI-5361]
This commit is contained in:
commit
d94d344c22
1 changed files with 1 additions and 1 deletions
|
@ -10,7 +10,7 @@ class ProjectsOverviewService
|
|||
@view_mode = @view_state.state.dig('projects', 'view_mode')
|
||||
|
||||
# Update sort if chanhed
|
||||
@sort = @view_state.state.dig('projects', @view_mode, 'sort')
|
||||
@sort = @view_state.state.dig('projects', @view_mode, 'sort') || 'atoz'
|
||||
if @params[:sort] && @sort != @params[:sort] &&
|
||||
%w(new old atoz ztoa archived_old archived_new).include?(@params[:sort])
|
||||
@view_state.state['projects'].merge!(Hash[@view_mode, { 'sort': @params[:sort] }.stringify_keys])
|
||||
|
|
Loading…
Reference in a new issue