mirror of
https://github.com/xtr-dev/payload-billing.git
synced 2025-12-10 19:03:23 +00:00
fix: Resolve TypeScript errors with PayloadCMS ID types
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -57,7 +57,7 @@ export async function updatePaymentStatus(
|
|||||||
// Get current payment to check for concurrent modifications
|
// Get current payment to check for concurrent modifications
|
||||||
const currentPayment = await payload.findByID({
|
const currentPayment = await payload.findByID({
|
||||||
collection: paymentsCollection,
|
collection: paymentsCollection,
|
||||||
id: paymentId
|
id: paymentId as any // Cast to avoid type mismatch between Id and PayloadCMS types
|
||||||
}) as Payment
|
}) as Payment
|
||||||
|
|
||||||
const now = new Date().toISOString()
|
const now = new Date().toISOString()
|
||||||
@@ -80,7 +80,7 @@ export async function updatePaymentStatus(
|
|||||||
try {
|
try {
|
||||||
const result = await payload.update({
|
const result = await payload.update({
|
||||||
collection: paymentsCollection,
|
collection: paymentsCollection,
|
||||||
id: paymentId,
|
id: paymentId as any, // Cast to avoid type mismatch between Id and PayloadCMS types
|
||||||
data: {
|
data: {
|
||||||
status,
|
status,
|
||||||
providerData: {
|
providerData: {
|
||||||
@@ -121,7 +121,7 @@ export async function updateInvoiceOnPaymentSuccess(
|
|||||||
|
|
||||||
await payload.update({
|
await payload.update({
|
||||||
collection: invoicesCollection,
|
collection: invoicesCollection,
|
||||||
id: invoiceId,
|
id: invoiceId as any, // Cast to avoid type mismatch between Id and PayloadCMS types
|
||||||
data: {
|
data: {
|
||||||
status: 'paid',
|
status: 'paid',
|
||||||
payment: payment.id
|
payment: payment.id
|
||||||
|
|||||||
Reference in New Issue
Block a user