1
0

feat(views): allow reordering views

Resolves https://community.vikunja.io/t/reordering-views/2394
This commit is contained in:
kolaente
2024-06-18 16:39:52 +02:00
parent 9f604eca79
commit d12deee977
5 changed files with 101 additions and 47 deletions

View File

@ -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