diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-24 18:06:03 +0000 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-24 18:06:03 +0000 |
commit | 09f4d0431ef3015653b6b78f1d413454519380bd (patch) | |
tree | 2110b9fd2d754df6969bfe1815d750a216bbe003 /server/src | |
parent | c8112e2c4a4550372b20b32f7f159c0f31605f4c (diff) | |
download | thermoprint-09f4d0431ef3015653b6b78f1d413454519380bd.tar thermoprint-09f4d0431ef3015653b6b78f1d413454519380bd.tar.gz thermoprint-09f4d0431ef3015653b6b78f1d413454519380bd.tar.bz2 thermoprint-09f4d0431ef3015653b6b78f1d413454519380bd.tar.xz thermoprint-09f4d0431ef3015653b6b78f1d413454519380bd.zip |
First attempt at deleteJob
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/Thermoprint/Server/API.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/server/src/Thermoprint/Server/API.hs b/server/src/Thermoprint/Server/API.hs index 1bbefb1..9e28d58 100644 --- a/server/src/Thermoprint/Server/API.hs +++ b/server/src/Thermoprint/Server/API.hs | |||
@@ -143,7 +143,14 @@ jobStatus :: API.JobId -> Handler JobStatus | |||
143 | jobStatus jobId = maybe (left err404) return . lookup jobId . toList =<< listJobs Nothing Nothing Nothing | 143 | jobStatus jobId = maybe (left err404) return . lookup jobId . toList =<< listJobs Nothing Nothing Nothing |
144 | 144 | ||
145 | deleteJob :: API.JobId -> Handler () | 145 | deleteJob :: API.JobId -> Handler () |
146 | deleteJob = return undefined | 146 | deleteJob jobId = do |
147 | printerIds <- asks (Map.keys . printers) | ||
148 | forM_ printerIds $ \pId -> do | ||
149 | (pId', p) <- lookupPrinter $ Just pId | ||
150 | -- liftIO . atomically . modifyTVar' (queue p) $ force . removeNeedle | ||
151 | undefined | ||
152 | where | ||
153 | needle = JobKey . SqlBackendKey $ castId jobId | ||
147 | 154 | ||
148 | listDrafts :: Handler (Map API.DraftId (Maybe DraftTitle)) | 155 | listDrafts :: Handler (Map API.DraftId (Maybe DraftTitle)) |
149 | listDrafts = return undefined | 156 | listDrafts = return undefined |