fix: Simplify PayloadCMS query structure for optimistic locking

- 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 <noreply@anthropic.com>
This commit is contained in:
2025-09-17 19:21:35 +02:00
parent d757c6942c
commit 555e52f0b8

View File

@@ -68,10 +68,8 @@ export async function updatePaymentStatus(
const result = await payload.updateMany({ const result = await payload.updateMany({
collection: paymentsCollection, collection: paymentsCollection,
where: { where: {
and: [ id: { equals: paymentId },
{ id: { equals: paymentId } }, version: { equals: currentPayment.version || 1 }
{ version: { equals: currentPayment.version || 1 } }
]
}, },
data: { data: {
status, status,