fix(api): unblock production build
This commit is contained in:
parent
84ee797e4f
commit
a2d0dddddd
6 changed files with 51 additions and 40 deletions
|
|
@ -20,7 +20,7 @@ instance Controller ApiV2ApiConsumersController where
|
|||
action ApiV2IndexApiConsumersAction = do
|
||||
case requestMethod ?request of
|
||||
"GET" -> listApiConsumers
|
||||
"POST" -> createApiConsumer
|
||||
"POST" -> createApiConsumerRecord
|
||||
_ -> respondWithStatus 405 $ object ["error" .= ("Method not allowed" :: Text)]
|
||||
|
||||
action ApiV2ShowApiConsumerAction { apiConsumerId } = do
|
||||
|
|
@ -28,7 +28,7 @@ instance Controller ApiV2ApiConsumersController where
|
|||
apiConsumer <- fetch apiConsumerId
|
||||
renderJson (apiConsumerToJson apiConsumer)
|
||||
|
||||
action ApiV2CreateApiConsumerAction = createApiConsumer
|
||||
action ApiV2CreateApiConsumerAction = createApiConsumerRecord
|
||||
|
||||
action ApiV2CreateApiConsumerKeyAction { apiConsumerId } = do
|
||||
when (requestMethod ?request /= "POST") do
|
||||
|
|
@ -48,8 +48,8 @@ listApiConsumers = do
|
|||
|> fetch
|
||||
renderJson $ paginatedResponse (map apiConsumerToJson consumers) page perPage total
|
||||
|
||||
createApiConsumer :: (?context :: ControllerContext, ?modelContext :: ModelContext, ?respond :: Respond, ?request :: Request) => IO ()
|
||||
createApiConsumer = do
|
||||
createApiConsumerRecord :: (?context :: ControllerContext, ?modelContext :: ModelContext, ?respond :: Respond, ?request :: Request) => IO ()
|
||||
createApiConsumerRecord = do
|
||||
_consumer <- requireApiConsumer
|
||||
let name = paramOrNothing @Text "name"
|
||||
description = paramOrNothing @Text "description"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue