mirror of
https://github.com/xtr-dev/payload-billing.git
synced 2025-12-09 18:33:24 +00:00
feat: add defaultPopulate configuration to payments collection
- Include defaultPopulate fields to simplify API responses - Ensure key payment details (amount, status, provider, etc.) are preloaded
This commit is contained in:
@@ -144,6 +144,18 @@ export function createPaymentsCollection(pluginConfig: BillingPluginConfig): Col
|
||||
useAsTitle: 'id',
|
||||
},
|
||||
fields,
|
||||
defaultPopulate: {
|
||||
id: true,
|
||||
provider: true,
|
||||
status: true,
|
||||
amount: true,
|
||||
currency: true,
|
||||
description: true,
|
||||
checkoutUrl: true,
|
||||
providerId: true,
|
||||
metadata: true,
|
||||
providerData: true,
|
||||
},
|
||||
hooks: {
|
||||
afterChange: [
|
||||
async ({ doc, operation, req, previousDoc }) => {
|
||||
|
||||
Reference in New Issue
Block a user