diff options
author | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-07-17 21:19:52 +0200 |
---|---|---|
committer | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-07-17 21:19:52 +0200 |
commit | 6831491b904403beb7fd3899b28e0deaa86d767d (patch) | |
tree | cdf8542b6d73383ba0b42db449e07a0efae03538 /server | |
parent | 2b9ceaead3f3cd80e973cccecb9a3eebc51154f7 (diff) | |
download | thermoprint-6831491b904403beb7fd3899b28e0deaa86d767d.tar thermoprint-6831491b904403beb7fd3899b28e0deaa86d767d.tar.gz thermoprint-6831491b904403beb7fd3899b28e0deaa86d767d.tar.bz2 thermoprint-6831491b904403beb7fd3899b28e0deaa86d767d.tar.xz thermoprint-6831491b904403beb7fd3899b28e0deaa86d767d.zip |
safer deletion
Diffstat (limited to 'server')
-rw-r--r-- | server/src/Thermoprint/Server/API.hs | 2 | ||||
-rw-r--r-- | server/thermoprint-server.cabal | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/server/src/Thermoprint/Server/API.hs b/server/src/Thermoprint/Server/API.hs index 8e17eb4..f7a8576 100644 --- a/server/src/Thermoprint/Server/API.hs +++ b/server/src/Thermoprint/Server/API.hs | |||
@@ -192,7 +192,7 @@ addDraft title content = do | |||
192 | 192 | ||
193 | updateDraft :: API.DraftId -> Maybe DraftTitle -> Printout -> Handler () | 193 | updateDraft :: API.DraftId -> Maybe DraftTitle -> Printout -> Handler () |
194 | updateDraft draftId title content = handle (\(KeyNotFound _) -> throwError $ err404) $ do | 194 | updateDraft draftId title content = handle (\(KeyNotFound _) -> throwError $ err404) $ do |
195 | runSqlPool (update (castId draftId) [ DraftTitle =. title, DraftContent =. content ]) =<< asks sqlPool | 195 | void . runSqlPool (updateGet (castId draftId) [ DraftTitle =. title, DraftContent =. content ]) =<< asks sqlPool |
196 | $(logInfo) $ "Updated draft #" <> (T.pack $ show (castId draftId :: Integer)) | 196 | $(logInfo) $ "Updated draft #" <> (T.pack $ show (castId draftId :: Integer)) |
197 | notify $ safeLink thermoprintAPI (Proxy :: Proxy ("draft" :> Capture "draftId" API.DraftId :> Get '[JSON] (Maybe DraftTitle, Printout))) $ draftId | 197 | notify $ safeLink thermoprintAPI (Proxy :: Proxy ("draft" :> Capture "draftId" API.DraftId :> Get '[JSON] (Maybe DraftTitle, Printout))) $ draftId |
198 | 198 | ||
diff --git a/server/thermoprint-server.cabal b/server/thermoprint-server.cabal index 37cf065..afb62db 100644 --- a/server/thermoprint-server.cabal +++ b/server/thermoprint-server.cabal | |||
@@ -2,7 +2,7 @@ | |||
2 | -- documentation, see http://haskell.org/cabal/users-guide/ | 2 | -- documentation, see http://haskell.org/cabal/users-guide/ |
3 | 3 | ||
4 | name: thermoprint-server | 4 | name: thermoprint-server |
5 | version: 2.0.0 | 5 | version: 2.0.1 |
6 | synopsis: Server for thermoprint-spec | 6 | synopsis: Server for thermoprint-spec |
7 | -- description: | 7 | -- description: |
8 | homepage: http://dirty-haskell.org/tags/thermoprint.html | 8 | homepage: http://dirty-haskell.org/tags/thermoprint.html |