aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-02-17 23:46:14 +0000
committerGregor Kleen <gkleen@yggdrasil.li>2016-02-17 23:46:14 +0000
commit39ae58ddbe3f59f99e4ce2e3d68cfdbccaaec202 (patch)
tree3a941b2a7ba1be0cab62663b9c636cf11e66a1b0 /spec
parent6a689cd5ca5c8061e3565e2bed2c3c8eafea34a4 (diff)
downloadthermoprint-39ae58ddbe3f59f99e4ce2e3d68cfdbccaaec202.tar
thermoprint-39ae58ddbe3f59f99e4ce2e3d68cfdbccaaec202.tar.gz
thermoprint-39ae58ddbe3f59f99e4ce2e3d68cfdbccaaec202.tar.bz2
thermoprint-39ae58ddbe3f59f99e4ce2e3d68cfdbccaaec202.tar.xz
thermoprint-39ae58ddbe3f59f99e4ce2e3d68cfdbccaaec202.zip
Tweaks to API to make servant happier
Diffstat (limited to 'spec')
-rw-r--r--spec/src/Thermoprint/API.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/src/Thermoprint/API.hs b/spec/src/Thermoprint/API.hs
index f5b7bee..d854e73 100644
--- a/spec/src/Thermoprint/API.hs
+++ b/spec/src/Thermoprint/API.hs
@@ -83,7 +83,7 @@ instance ToText UTCTime where
83 83
84type ThermoprintAPI = "printers" :> Get '[JSON] (Map PrinterId PrinterStatus) 84type ThermoprintAPI = "printers" :> Get '[JSON] (Map PrinterId PrinterStatus)
85 :<|> "jobs" :> ( 85 :<|> "jobs" :> (
86 QueryParam "printer" PrinterId 86 QueryParam "printer" PrinterId -- TODO: this is silly, introduce data Range a = Range { rMin :: a, rMax :: a }
87 :> QueryParam "min" JobId 87 :> QueryParam "min" JobId
88 :> QueryParam "max" JobId 88 :> QueryParam "max" JobId
89 :> QueryParam "minTime" UTCTime 89 :> QueryParam "minTime" UTCTime
@@ -94,16 +94,16 @@ type ThermoprintAPI = "printers" :> Get '[JSON] (Map PrinterId PrinterStatus)
94 :<|> "job" :> Capture "jobId" JobId :> ( 94 :<|> "job" :> Capture "jobId" JobId :> (
95 Get '[JSON] Printout 95 Get '[JSON] Printout
96 :<|> "status" :> Get '[JSON] JobStatus 96 :<|> "status" :> Get '[JSON] JobStatus
97 :<|> Delete '[] () 97 :<|> Delete '[PlainText] ()
98 ) 98 )
99 :<|> "drafts" :> ( 99 :<|> "drafts" :> (
100 Get '[JSON] (Map DraftId (Maybe DraftTitle)) 100 Get '[JSON] (Map DraftId (Maybe DraftTitle))
101 :<|> QueryParam "title" DraftTitle :> ReqBody '[JSON] Printout :> Post '[JSON] DraftId 101 :<|> QueryParam "title" DraftTitle :> ReqBody '[JSON] Printout :> Post '[JSON] DraftId
102 ) 102 )
103 :<|> "draft" :> Capture "draftId" DraftId :> ( 103 :<|> "draft" :> Capture "draftId" DraftId :> (
104 QueryParam "title" DraftTitle :> ReqBody '[JSON] Printout :> Put '[] () 104 QueryParam "title" DraftTitle :> ReqBody '[JSON] Printout :> Put '[PlainText] ()
105 :<|> Get '[JSON] (Maybe DraftTitle, Printout) 105 :<|> Get '[JSON] (Maybe DraftTitle, Printout)
106 :<|> Delete '[] () 106 :<|> Delete '[PlainText] ()
107 :<|> QueryParam "printer" PrinterId :> Post '[JSON] JobId 107 :<|> QueryParam "printer" PrinterId :> Post '[JSON] JobId
108 ) 108 )
109 109