Permalink
Browse files

Expose /work/find-by-artist

  • Loading branch information...
1 parent 70d8c36 commit 00fb27085ad5c96b99f85c8ded171852cbb52583 @ocharles ocharles committed Mar 4, 2013
Showing with 9 additions and 1 deletion.
  1. +1 −1 musicbrainz-data
  2. +6 −0 src/MusicBrainz/API/Work.hs
  3. +1 −0 src/MusicBrainz/Service.hs
  4. +1 −0 test/suite/Handlers.hs
@@ -14,6 +14,7 @@ import MusicBrainz hiding (coreRef)
import MusicBrainz.API
import qualified MusicBrainz.API.Common as Common
import qualified MusicBrainz.Data as MB
+import qualified MusicBrainz.Data.Work as MB
import MusicBrainz.API.JSON
--------------------------------------------------------------------------------
@@ -84,3 +85,8 @@ merge = Common.merge
--------------------------------------------------------------------------------
getRevision :: Form Text MusicBrainz (Entity (Revision Work))
getRevision = Common.getRevision
+
+
+--------------------------------------------------------------------------------
+findByArtist :: Form Text MusicBrainz [CoreEntity Work]
+findByArtist = runApi $ MB.findByArtist <$> "artist" .: coreRef
@@ -320,6 +320,7 @@ serviceInit connInfo sessionStore =
, ("/work/create", expose Work.create)
, ("/work/eligible-for-cleanup", expose Work.eligibleForCleanup)
+ , ("/work/find-by-artist", expose Work.findByArtist)
, ("/work/find-latest", expose Work.findLatest)
, ("/work/get-revision", expose Work.getRevision)
, ("/work/merge", expose Work.merge)
View
@@ -90,6 +90,7 @@ tests = map testHandlerExists
, "/url/view-revision"
, "/work/create"
, "/work/eligible-for-cleanup"
+ , "/work/find-by-artist"
, "/work/find-latest"
, "/work/get-revision"
, "/work/merge"

0 comments on commit 00fb270

Please sign in to comment.