1
0

feat(views): save task position

This commit is contained in:
kolaente
2024-03-16 11:36:37 +01:00
parent c36fdb9f5d
commit 786e67f692
6 changed files with 59 additions and 4 deletions

View File

@ -306,6 +306,7 @@ func GetProjectViewByIDAndProject(s *xorm.Session, id, projectID int64) (view *P
}
func GetProjectViewByID(s *xorm.Session, id int64) (view *ProjectView, err error) {
view = &ProjectView{}
exists, err := s.
Where("id = ?", id).
NoAutoCondition().

View File

@ -46,7 +46,10 @@ func (tp *TaskPosition) TableName() string {
}
func (tp *TaskPosition) CanUpdate(s *xorm.Session, a web.Auth) (bool, error) {
pv := &ProjectView{ID: tp.ProjectViewID}
pv, err := GetProjectViewByID(s, tp.ProjectViewID)
if err != nil {
return false, err
}
return pv.CanUpdate(s, a)
}