From 9aa374a358f1c8934c67c048e74d371463fe52f8 Mon Sep 17 00:00:00 2001 From: Lucian Buzzo Date: Sat, 2 Nov 2024 19:23:39 +0000 Subject: [PATCH] fix: remove unnecessary yates_id field on transaction --- src/index.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index 16e5f2c..f799331 100644 --- a/src/index.ts +++ b/src/index.ts @@ -245,11 +245,15 @@ export const createClient = ( (prisma as any)._requestHandler.dataloader.options.batchBy = ( request: any, ) => { - return request.transaction?.yates_id - ? request.transaction.yates_id + (getBatchId(request.protocolQuery) || "") - : request.transaction?.id - ? `transaction-${request.transaction.id}` - : getBatchId(request.protocolQuery); + const batchIdPQ = getBatchId(request.protocolQuery); + + if (request.transaction?.id) { + return `transaction-${request.transaction.id}${ + batchIdPQ ? `-${batchIdPQ}` : "" + }`; + } + + return getBatchId(request.protocolQuery); }; let tickActive = false; @@ -291,7 +295,6 @@ export const createClient = ( transaction: { kind: "itx", id: txId, - yates_id: key, }, }), ),