On work/survey update, regenerate description from markdown
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nemunaire 2022-09-16 12:14:26 +02:00
parent 5b3bdb0429
commit 7f7561ad3e
2 changed files with 3 additions and 0 deletions

View file

@ -311,6 +311,8 @@ func (q *Question) Update() (*Question, error) {
if _, err := DBExec("UPDATE survey_quests SET id_survey = ?, title = ?, description = ?, placeholder = ?, kind = ? WHERE id_question = ?", q.IdSurvey, q.Title, q.DescriptionRaw, q.Placeholder, q.Kind, q.Id); err != nil {
return nil, err
} else {
q.Description = string(blackfriday.Run([]byte(q.DescriptionRaw)))
_questions_cache_mutex.Lock()
_questions_cache[q.Id] = q
_questions_cache_mutex.Unlock()