refactor(payments): extract PAYMENT_METADATA_TYPE constants
This commit is contained in:
parent
bb3ec5ec6a
commit
678fdfe388
4 changed files with 24 additions and 4 deletions
|
|
@ -10,10 +10,10 @@ export default defineEventHandler(async (event) => {
|
|||
const body = await validateBody(event, helcimInitializePaymentSchema)
|
||||
const metaType = body.metadata?.type
|
||||
|
||||
const isEventTicket = metaType === 'event_ticket'
|
||||
const isSeriesTicket = metaType === 'series_ticket'
|
||||
const isEventTicket = metaType === PAYMENT_METADATA_TYPES.EVENT_TICKET
|
||||
const isSeriesTicket = metaType === PAYMENT_METADATA_TYPES.SERIES_TICKET
|
||||
const isTicket = isEventTicket || isSeriesTicket
|
||||
const isMembershipSignup = metaType === 'membership_signup'
|
||||
const isMembershipSignup = metaType === PAYMENT_METADATA_TYPES.MEMBERSHIP_SIGNUP
|
||||
|
||||
if (!isTicket) {
|
||||
if (isMembershipSignup) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue