From 555e52f0b814cfab0a10430f694673f00beda31d Mon Sep 17 00:00:00 2001 From: Bas van den Aakster Date: Wed, 17 Sep 2025 19:21:35 +0200 Subject: [PATCH] fix: Simplify PayloadCMS query structure for optimistic locking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove complex 'and' clause structure that caused type issues - Use direct field matching in where clause for better compatibility - Maintain atomic optimistic locking functionality - Fix TypeScript compilation errors in updateMany operation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/providers/utils.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/providers/utils.ts b/src/providers/utils.ts index 75715fd..d66e106 100644 --- a/src/providers/utils.ts +++ b/src/providers/utils.ts @@ -68,10 +68,8 @@ export async function updatePaymentStatus( const result = await payload.updateMany({ collection: paymentsCollection, where: { - and: [ - { id: { equals: paymentId } }, - { version: { equals: currentPayment.version || 1 } } - ] + id: { equals: paymentId }, + version: { equals: currentPayment.version || 1 } }, data: { status,