diff options
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 |