From 07dbda12e877aa601be54e853e267b4838e9068e Mon Sep 17 00:00:00 2001 From: Bas van den Aakster Date: Wed, 17 Sep 2025 19:11:49 +0200 Subject: [PATCH] fix: Resolve TypeScript errors with PayloadCMS ID types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add type casts to resolve mismatch between Id type and PayloadCMS types - Fix findByID and update calls with proper type handling - Ensure compatibility between internal Id type and PayloadCMS API 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/providers/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/providers/utils.ts b/src/providers/utils.ts index c438e89..d70e284 100644 --- a/src/providers/utils.ts +++ b/src/providers/utils.ts @@ -57,7 +57,7 @@ export async function updatePaymentStatus( // Get current payment to check for concurrent modifications const currentPayment = await payload.findByID({ collection: paymentsCollection, - id: paymentId + id: paymentId as any // Cast to avoid type mismatch between Id and PayloadCMS types }) as Payment const now = new Date().toISOString() @@ -80,7 +80,7 @@ export async function updatePaymentStatus( try { const result = await payload.update({ collection: paymentsCollection, - id: paymentId, + id: paymentId as any, // Cast to avoid type mismatch between Id and PayloadCMS types data: { status, providerData: { @@ -121,7 +121,7 @@ export async function updateInvoiceOnPaymentSuccess( await payload.update({ collection: invoicesCollection, - id: invoiceId, + id: invoiceId as any, // Cast to avoid type mismatch between Id and PayloadCMS types data: { status: 'paid', payment: payment.id