Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eighty-paths-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/dashboard": major
---

fix(dashboard): fetch all assignable policies to prevent dropping revocations beyond first page
5 changes: 5 additions & 0 deletions .changeset/some-suits-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/core-flows": patch
---

fix(core-flows): emit payment.captured event when authorizing payment session with captures
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ export const EditRolePermissionsForm = ({
// Unpaginated assignable id set, used only to scope the diff on submit so we
// never strip policies the actor cannot see.
const { data: allAssignable, isPending: isAssignableSetLoading } =
useRbacAssignablePolicies()
useRbacAssignablePolicies({
limit: 9999,
fields: "id",
})
const assignableIds = useMemo(
() => new Set((allAssignable?.policies ?? []).map((p) => p.id)),
[allAssignable?.policies]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MedusaError, PaymentSessionStatus } from "@medusajs/framework/utils"
import { MedusaError, PaymentEvents, PaymentSessionStatus } from "@medusajs/framework/utils"
import {
createStep,
createWorkflow,
Expand All @@ -8,9 +8,10 @@ import {
WorkflowData,
WorkflowResponse,
} from "@medusajs/framework/workflows-sdk"
import { useQueryGraphStep } from "../../common"
import { emitEventStep, useQueryGraphStep } from "../../common"
import { addOrderTransactionStep } from "../../order/steps/add-order-transaction"
import { authorizePaymentSessionStep } from "../steps"
import { emit } from "process"

/**
* The data to authorize a pending payment session for an existing order.
Expand Down Expand Up @@ -108,7 +109,20 @@ export const authorizePaymentSessionForOrderWorkflow = createWorkflow(
)

addOrderTransactionStep(orderTransactions)
})
});

when("emit-payment-captured-event",
{ payment},
({payment}) => {
return !!payment?.captures?.length
}).then(() => {
emitEventStep({
eventName: PaymentEvents.CAPTURED,
data: {
id: payment.id
}
})
})

return new WorkflowResponse(payment)
}
Expand Down
Loading