mirror of
https://github.com/xtr-dev/payload-billing.git
synced 2025-12-10 02:43:24 +00:00
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:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user