feat(views): allow reordering views
Resolves https://community.vikunja.io/t/reordering-views/2394
This commit is contained in:
@ -302,9 +302,7 @@ func (p *Project) ReadOne(s *xorm.Session, a web.Auth) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
err = s.
|
||||
Where("project_id = ?", p.ID).
|
||||
Find(&p.Views)
|
||||
p.Views, err = getViewsForProject(s, p.ID)
|
||||
return
|
||||
}
|
||||
|
||||
@ -640,6 +638,7 @@ func addProjectDetails(s *xorm.Session, projects []*Project, a web.Auth) (err er
|
||||
views := []*ProjectView{}
|
||||
err = s.
|
||||
In("project_id", projectIDs).
|
||||
OrderBy("position asc").
|
||||
Find(&views)
|
||||
if err != nil {
|
||||
return
|
||||
|
@ -160,6 +160,7 @@ func getViewsForProject(s *xorm.Session, projectID int64) (views []*ProjectView,
|
||||
views = []*ProjectView{}
|
||||
err = s.
|
||||
Where("project_id = ?", projectID).
|
||||
OrderBy("position asc").
|
||||
Find(&views)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user