Skip to content

Commit

Permalink
fix: remove unnecessary yates_id field on transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
LucianBuzzo authored and sebmellen committed Nov 4, 2024
1 parent 9bc23af commit 93f3a1f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -291,7 +295,6 @@ export const createClient = (
transaction: {
kind: "itx",
id: txId,
yates_id: key,
},
}),
),
Expand Down

0 comments on commit 93f3a1f

Please sign in to comment.