diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/logikorr.clj | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/logikorr.clj b/src/logikorr.clj index 5a646e6..cf35929 100644 --- a/src/logikorr.clj +++ b/src/logikorr.clj @@ -120,14 +120,15 @@ :last-name (:last-name student)}))) (defn update-student-score [id score-number new-score-value] - (let [student (find-student-by-id id) - score (:score student) - num (Integer. score-number)] - (ds-update (assoc student - :score (concat (take num score) - [(Float. new-score-value)] - (drop (+ 1 num) score))))) - "\"OK\"") + (with-ds-transaction + (let [student (find-student-by-id id) + score (:score student) + num (Integer. score-number)] + (ds-update (assoc student + :score (concat (take num score) + [(Float. new-score-value)] + (drop (+ 1 num) score))))) + "\"OK\"")) (defn make-new-revision [] (with-ds-transaction |