add ability to agree with results closes #96
This commit is contained in:
@@ -41,10 +41,23 @@ const (
|
||||
TASK_TYPE_RETRAINING
|
||||
)
|
||||
|
||||
type TaskAgreement int
|
||||
|
||||
const (
|
||||
TASK_AGREE_DISAGRE TaskAgreement = -1 + iota
|
||||
TASK_AGREE_NONE
|
||||
TASK_AGREE_AGREE
|
||||
)
|
||||
|
||||
func (t Task) UpdateStatus(base BasePack, status TaskStatus, message string) (err error) {
|
||||
return UpdateTaskStatus(base, t.Id, status, message)
|
||||
}
|
||||
|
||||
func (t Task) SetAgreement(base BasePack, agreement TaskAgreement) (err error) {
|
||||
_, err = base.GetDb().Exec("update tasks set user_confirmed=$1 where id=$2", agreement, t.Id)
|
||||
return
|
||||
}
|
||||
|
||||
/**
|
||||
* Call the UpdateStatus function and logs on the case of failure!
|
||||
* This varient does not return any error message
|
||||
|
||||
Reference in New Issue
Block a user