@@ -61,7 +61,11 @@ import { trackingIDHandler } from './api/tracking-id/handler'
6161import { dashboardQueriesHandler } from './api/dashboards/handler'
6262import { fontsHandler } from './api/fonts/handler'
6363import { recordNotificationHandler } from './api/record-notification/handler'
64- import { customEventHandler } from '@countryconfig/api/custom-event/handler'
64+ import {
65+ getCustomEventsHandler ,
66+ onAnyActionHandler ,
67+ onRegisterHandler
68+ } from '@countryconfig/api/custom-event/handler'
6569
6670export interface ITokenPayload {
6771 sub : string
@@ -548,13 +552,33 @@ export async function createServer() {
548552 server . route ( {
549553 method : 'GET' ,
550554 path : '/events' ,
551- handler : customEventHandler ,
555+ handler : getCustomEventsHandler ,
552556 options : {
553557 tags : [ 'api' , 'custom-event' ] ,
554558 description : 'Serves custom events'
555559 }
556560 } )
557561
562+ server . route ( {
563+ method : 'POST' ,
564+ path : '/events/TENNIS_CLUB_MEMBERSHIP/actions/register' ,
565+ handler : onRegisterHandler ,
566+ options : {
567+ tags : [ 'api' , 'custom-event' ] ,
568+ description : 'Receives notifications on event actions'
569+ }
570+ } )
571+
572+ server . route ( {
573+ method : 'POST' ,
574+ path : '/events/{event}/actions/{action}' ,
575+ handler : onAnyActionHandler ,
576+ options : {
577+ tags : [ 'api' , 'custom-event' ] ,
578+ description : 'Receives notifications on event actions'
579+ }
580+ } )
581+
558582 server . ext ( {
559583 type : 'onRequest' ,
560584 method ( request : Hapi . Request & { sentryScope ?: any } , h ) {
0 commit comments