diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-25 17:51:49 +0000 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-25 17:51:49 +0000 |
commit | 5978ff72f2a374e991bef098555325dd95a9f509 (patch) | |
tree | 4e7389cb73946baa3792818e0cd2e557637f394c /server | |
parent | 6e2883f57decbdcc8cbfefb8cdd9b118212811d5 (diff) | |
download | thermoprint-5978ff72f2a374e991bef098555325dd95a9f509.tar thermoprint-5978ff72f2a374e991bef098555325dd95a9f509.tar.gz thermoprint-5978ff72f2a374e991bef098555325dd95a9f509.tar.bz2 thermoprint-5978ff72f2a374e991bef098555325dd95a9f509.tar.xz thermoprint-5978ff72f2a374e991bef098555325dd95a9f509.zip |
Renamed deleteJob to abortJob
it was determined that the semantics should really be to remove the job
iff it's queued but not currently being printed (per printer)
Diffstat (limited to 'server')
-rw-r--r-- | server/src/Thermoprint/Server/API.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/src/Thermoprint/Server/API.hs b/server/src/Thermoprint/Server/API.hs index 66a594b..5fbb18e 100644 --- a/server/src/Thermoprint/Server/API.hs +++ b/server/src/Thermoprint/Server/API.hs | |||
@@ -80,7 +80,7 @@ thermoprintServer :: ServerT ThermoprintAPI Handler | |||
80 | -- ^ A 'servant-server' for 'ThermoprintAPI' | 80 | -- ^ A 'servant-server' for 'ThermoprintAPI' |
81 | thermoprintServer = listPrinters | 81 | thermoprintServer = listPrinters |
82 | :<|> (listJobs :<|> queueJob) | 82 | :<|> (listJobs :<|> queueJob) |
83 | :<|> getJob <||> jobStatus <||> deleteJob | 83 | :<|> getJob <||> jobStatus <||> abortJob |
84 | :<|> (listDrafts :<|> addDraft) | 84 | :<|> (listDrafts :<|> addDraft) |
85 | :<|> updateDraft <||> getDraft <||> deleteDraft <||> printDraft | 85 | :<|> updateDraft <||> getDraft <||> deleteDraft <||> printDraft |
86 | where | 86 | where |
@@ -138,8 +138,8 @@ getJob jobId = fmap jobContent . maybe (left err404) return =<< runSqlPool (get | |||
138 | jobStatus :: API.JobId -> Handler JobStatus | 138 | jobStatus :: API.JobId -> Handler JobStatus |
139 | jobStatus jobId = maybe (left err404) return . lookup jobId . toList =<< listJobs Nothing Nothing Nothing | 139 | jobStatus jobId = maybe (left err404) return . lookup jobId . toList =<< listJobs Nothing Nothing Nothing |
140 | 140 | ||
141 | deleteJob :: API.JobId -> Handler () | 141 | abortJob :: API.JobId -> Handler () |
142 | deleteJob jobId = do | 142 | abortJob jobId = do |
143 | printerIds <- asks (Map.keys . printers) | 143 | printerIds <- asks (Map.keys . printers) |
144 | forM_ printerIds $ \pId -> do | 144 | forM_ printerIds $ \pId -> do |
145 | (pId', p) <- lookupPrinter $ Just pId | 145 | (pId', p) <- lookupPrinter $ Just pId |