On work/survey update, regenerate description from markdown
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
5b3bdb0429
commit
7f7561ad3e
@ -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 {
|
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
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
|
q.Description = string(blackfriday.Run([]byte(q.DescriptionRaw)))
|
||||||
|
|
||||||
_questions_cache_mutex.Lock()
|
_questions_cache_mutex.Lock()
|
||||||
_questions_cache[q.Id] = q
|
_questions_cache[q.Id] = q
|
||||||
_questions_cache_mutex.Unlock()
|
_questions_cache_mutex.Unlock()
|
||||||
|
1
works.go
1
works.go
@ -345,6 +345,7 @@ func (w *Work) Update() (*Work, error) {
|
|||||||
if _, err := DBExec("UPDATE works SET title = ?, promo = ?, grp = ?, shown = ?, description = ?, tag = ?, submission_url = ?, corrected = ?, start_availability = ?, end_availability = ? WHERE id_work = ?", w.Title, w.Promo, w.Group, w.Shown, w.DescriptionRaw, w.Tag, w.SubmissionURL, w.Corrected, w.StartAvailability, w.EndAvailability, w.Id); err != nil {
|
if _, err := DBExec("UPDATE works SET title = ?, promo = ?, grp = ?, shown = ?, description = ?, tag = ?, submission_url = ?, corrected = ?, start_availability = ?, end_availability = ? WHERE id_work = ?", w.Title, w.Promo, w.Group, w.Shown, w.DescriptionRaw, w.Tag, w.SubmissionURL, w.Corrected, w.StartAvailability, w.EndAvailability, w.Id); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
|
w.Description = string(blackfriday.Run([]byte(w.DescriptionRaw)))
|
||||||
return w, err
|
return w, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user