This commit is contained in:
ntr committed 2022-08-08 11:22:05 +10:00
1 parent bd32044427
commit faa2e70e08
4 files changed
+73 -1

No files matched your search

+8
View File
@@ -106,6 +106,8 @@ export default function createApi(log: Log, pg: Pg, discogs) {
router.get('/bundles', async (ctx, next) => {
const bundles = await getBundles();
const search = await discogs.searchMaster('nine inch nails', 'the fragile');
log.info(search);
ctx.response.body = bundles;
})
@@ -146,6 +148,12 @@ export default function createApi(log: Log, pg: Pg, discogs) {
ctx.response.body = want;
});
router.post('/want/search', async function wantPost(ctx, next) {
const { artist, title } = ctx.request.body;
const results = await discogs.search(artist, title);
ctx.response.body = results;
});
app.use(router.routes());
return {