mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-09 13:28:53 +08:00
Add default sorting to ProjectsOverviewService [SCI-5361]
This commit is contained in:
parent
163a2d1e60
commit
1c27b99ba5
1 changed files with 1 additions and 1 deletions
|
@ -10,7 +10,7 @@ class ProjectsOverviewService
|
||||||
@view_mode = @view_state.state.dig('projects', 'view_mode')
|
@view_mode = @view_state.state.dig('projects', 'view_mode')
|
||||||
|
|
||||||
# Update sort if chanhed
|
# 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] &&
|
if @params[:sort] && @sort != @params[:sort] &&
|
||||||
%w(new old atoz ztoa archived_old archived_new).include?(@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])
|
@view_state.state['projects'].merge!(Hash[@view_mode, { 'sort': @params[:sort] }.stringify_keys])
|
||||||
|
|
Loading…
Add table
Reference in a new issue