feat(views): save task position
This commit is contained in:
@ -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().
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user