From f79c1869093b779a4498b3dc832da0304ff14d90 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sat, 11 May 2024 22:21:23 +0200 Subject: refactor(users/Profpatsch/whatcd-resolver): artistPage hander fn Change-Id: Ia0f5d358e9be99d39117ba13fce528f418daf416 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11649 Autosubmit: Profpatsch Reviewed-by: Profpatsch Tested-by: BuildkiteCI --- users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'users/Profpatsch') diff --git a/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs b/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs index 28aa0f2b10da..26213c5fea32 100644 --- a/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs +++ b/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs @@ -216,7 +216,7 @@ htmlUi = do ( label @"dbId" <$> (singleQueryArgument "db_id" Field.utf8) ) - pure $ [fmt|Artist ID: {qry.dbId}|] + artistPage qry ), ( "autorefresh", respond.plain $ do @@ -305,6 +305,13 @@ htmlUi = do |] +artistPage :: (HasField "dbId" dat Text, Applicative m) => dat -> m Html +artistPage dat = + pure + [hsx| + Artist ID: {dat.dbId} + |] + type Handlers m = HandlerResponses m -> Map Text (m ResponseReceived) data HandlerResponses m = HandlerResponses -- cgit 1.4.1