-
-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent removing payment method from processing orders and return payment method info even if deleted #10073
base: main
Are you sure you want to change the base?
Changes from 4 commits
8042635
35c32d3
bd42c94
7b229c7
dff243d
725dcc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,7 +202,7 @@ export const GraphQLOrder = new GraphQLObjectType({ | |
type: GraphQLPaymentMethod, | ||
resolve(order, _, req) { | ||
if (order.PaymentMethodId) { | ||
return req.loaders.PaymentMethod.byId.load(order.PaymentMethodId); | ||
return req.loaders.PaymentMethod.byIdIncludeDeleted.load(order.PaymentMethodId); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really need to expose deleted assets? What is the use case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When looking at past contributions / transactions. If the user removes the payment method, we still want to show info about it in the contribution list/drawers. |
||
} | ||
}, | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick reminder: this is only safe because we use the primary key ID in this query.
Hypothetically, we should not implement stuff like
byCollectiveIdIncludedDeleted
because our custom indexes exclude deleted records.