fix(api): unblock production build

This commit is contained in:
tegwick 2026-06-14 14:42:11 +02:00
parent 84ee797e4f
commit a2d0dddddd
6 changed files with 51 additions and 40 deletions

View file

@ -15,7 +15,7 @@ instance Controller ApiV2HubsController where
action ApiV2IndexHubsAction = do
case requestMethod ?request of
"GET" -> listHubs
"POST" -> createHub
"POST" -> createApiHub
_ -> respondWithStatus 405 $ object ["error" .= ("Method not allowed" :: Text)]
action ApiV2ShowHubAction { hubId } = do
@ -23,7 +23,7 @@ instance Controller ApiV2HubsController where
hub <- fetch hubId
renderJson (hubToJson hub)
action ApiV2CreateHubAction = createHub
action ApiV2CreateHubAction = createApiHub
listHubs :: (?context :: ControllerContext, ?modelContext :: ModelContext, ?respond :: Respond, ?request :: Request) => IO ()
listHubs = do
@ -38,8 +38,8 @@ listHubs = do
|> fetch
renderJson $ paginatedResponse (map hubToJson hubs) page perPage total
createHub :: (?context :: ControllerContext, ?modelContext :: ModelContext, ?respond :: Respond, ?request :: Request) => IO ()
createHub = do
createApiHub :: (?context :: ControllerContext, ?modelContext :: ModelContext, ?respond :: Respond, ?request :: Request) => IO ()
createApiHub = do
_consumer <- requireApiConsumer
let slug = paramOrNothing @Text "slug"
name = paramOrNothing @Text "name"