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

+6
View File
@@ -18,6 +18,7 @@ export interface Pg {
wantCreate: (discogsWant: any, user: User) => Promise<Want>,
wantList: (user: User) => Promise<Want[]>,
wantsToSync: () => Promise<Want[]>,
listingUpsert: (listing: Listing, want: Want) => Promise<Listing>,
listingFind: (id: DiscogsListing) => Promise<Listing>,
listingRmUnlisted: (want: Want, ids: DiscogsListing[]) => Promise<number>,
@@ -60,6 +61,10 @@ export default function createPg(log: Log, prisma: PrismaClient): Pg {
});
}
async function wantsToSync() {
return prisma.want.findMany({});
}
async function wantCreate(discogsRelease, user) {
const data: { userId: UUID, release: DiscogsListing, data: any } = {
data: discogsRelease,
@@ -149,6 +154,7 @@ export default function createPg(log: Log, prisma: PrismaClient): Pg {
wantCreate,
wantList,
wantsToSync,
listingUpsert,
listingFind,
listingRmUnlisted,