This commit is contained in:
ntr committed 2022-08-18 00:34:46 +10:00
1 parent 30bf7426e4
commit 323c7877b1
13 files changed
+94 -52

No files matched your search

+3 -6
View File
@@ -153,12 +153,9 @@ export default function createApi(log: Log, pg: Pg, discogs, events) {
const { releaseId } = ctx.request.body;
const user = await pg.userFindId(ctx.state.user.id);
const release = await discogs.release(releaseId);
const want = await pg.wantCreate([release], user);
// fetch listings
const listings = await discogs.listings(want);
ctx.response.body = { want, listings };
const want = await pg.wantCreate(release, user);
events.emit(Events.WantsAdded, [want]);
ctx.response.body = [want];
});
router.post('/want/discogs', async function wantListPost(ctx, next) {