diff --git a/api/src/events.ts b/api/src/events.ts index 1a47f9f..81c9744 100644 --- a/api/src/events.ts +++ b/api/src/events.ts @@ -65,13 +65,13 @@ export default function createEvents(log: Log, pg: Pg, discogs, offers) { log.info({ event: Events.ListingsUpdated, bundles: bundles.length }); for (const bundle of bundles) { - log.info({ seller: bundle.seller, items: bundle.items.length }, 'generating offers...'); + log.debug({ seller: bundle.seller, items: bundle.items.length }, 'generating offers...'); const listingIds = bundle.items.map(i => i.id); const updatedOffers = await offers.generate(listingIds, 100, 30) - log.info({ offers: updatedOffers.length }, 'offers set'); + log.debug({ offers: updatedOffers.length }, 'offers set'); } - log.info('offers up to date'); + log.trace('offers up to date'); }); events.on(Events.Connection, async function onConnection({ ws, id }) { diff --git a/api/src/offers.ts b/api/src/offers.ts index c7b7034..c9fba86 100644 --- a/api/src/offers.ts +++ b/api/src/offers.ts @@ -22,7 +22,7 @@ function sortOffers(o) { export default function createOffers(log: Log, pg: Pg) { async function generate(listingIds: DiscogsListing[], bulkShipping: number, baseShipping: number) { - log.info('generateOffers', { listingIds, bulkShipping, baseShipping }); + log.debug('generateOffers', { listingIds, bulkShipping, baseShipping }); const listings = await pg.listingByIds(listingIds); // log.info({ listings }, 'creating offers for listings') diff --git a/api/src/pg.ts b/api/src/pg.ts index 7708426..c8a436f 100644 --- a/api/src/pg.ts +++ b/api/src/pg.ts @@ -59,9 +59,10 @@ export default function createPg(log: Log, prisma: PrismaClient): Pg { include: { want: true, }, - orderBy: { - total: 'asc', - }, + orderBy: [ + { total: 'asc' }, + { listingId: 'asc' }, + ], }); } diff --git a/client/src/components/want.offers.tsx b/client/src/components/want.offers.tsx index 75c85cb..88b9da8 100644 --- a/client/src/components/want.offers.tsx +++ b/client/src/components/want.offers.tsx @@ -26,7 +26,8 @@ function OfferLine(offer) { return (