add ability to agree with results closes #96

This commit is contained in:
2024-04-16 19:03:30 +01:00
parent f165e9e744
commit 00ddb91a22
4 changed files with 76 additions and 6 deletions

View File

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