diff options
author | Sebastian <sebasjm@gmail.com> | 2023-01-27 15:08:03 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-01-27 15:08:25 -0300 |
commit | eebb85bef4bb6bba41533fa0ff343cf2f1995761 (patch) | |
tree | 08ac7d3197d662bd8fadc747a912023364a4f9c7 /packages/merchant-backoffice-ui/src/InstanceRoutes.tsx | |
parent | 1b2b5d62de5888eae895db69cf6ae51dbfddb32b (diff) | |
download | wallet-core-eebb85bef4bb6bba41533fa0ff343cf2f1995761.tar.xz |
webhook api
Diffstat (limited to 'packages/merchant-backoffice-ui/src/InstanceRoutes.tsx')
-rw-r--r-- | packages/merchant-backoffice-ui/src/InstanceRoutes.tsx | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/packages/merchant-backoffice-ui/src/InstanceRoutes.tsx b/packages/merchant-backoffice-ui/src/InstanceRoutes.tsx index 3be793ada..56f223620 100644 --- a/packages/merchant-backoffice-ui/src/InstanceRoutes.tsx +++ b/packages/merchant-backoffice-ui/src/InstanceRoutes.tsx @@ -51,6 +51,9 @@ import TemplateCreatePage from "./paths/instance/templates/create/index.js"; import TemplateUsePage from "./paths/instance/templates/use/index.js"; import TemplateListPage from "./paths/instance/templates/list/index.js"; import TemplateUpdatePage from "./paths/instance/templates/update/index.js"; +import WebhookCreatePage from "./paths/instance/webhooks/create/index.js"; +import WebhookListPage from "./paths/instance/webhooks/list/index.js"; +import WebhookUpdatePage from "./paths/instance/webhooks/update/index.js"; import TransferCreatePage from "./paths/instance/transfers/create/index.js"; import TransferListPage from "./paths/instance/transfers/list/index.js"; import InstanceUpdatePage, { @@ -87,6 +90,10 @@ export enum InstancePaths { templates_update = "/templates/:tid/update", templates_new = "/templates/new", templates_use = "/templates/:tid/use", + + webhooks_list = "/webhooks", + webhooks_update = "/webhooks/:tid/update", + webhooks_new = "/webhooks/new", } // eslint-disable-next-line @typescript-eslint/no-empty-function @@ -390,6 +397,45 @@ export function InstanceRoutes({ }} /> {/** + * Webhooks pages + */} + <Route + path={InstancePaths.webhooks_list} + component={WebhookListPage} + onUnauthorized={LoginPageAccessDenied} + onNotFound={IfAdminCreateDefaultOr(NotFoundPage)} + onLoadError={ServerErrorRedirectTo(InstancePaths.update)} + onCreate={() => { + route(InstancePaths.webhooks_new); + }} + onSelect={(id: string) => { + route(InstancePaths.webhooks_update.replace(":tid", id)); + }} + /> + <Route + path={InstancePaths.webhooks_update} + component={WebhookUpdatePage} + onConfirm={() => { + route(InstancePaths.webhooks_list); + }} + onUnauthorized={LoginPageAccessDenied} + onLoadError={ServerErrorRedirectTo(InstancePaths.webhooks_list)} + onNotFound={IfAdminCreateDefaultOr(NotFoundPage)} + onBack={() => { + route(InstancePaths.webhooks_list); + }} + /> + <Route + path={InstancePaths.webhooks_new} + component={WebhookCreatePage} + onConfirm={() => { + route(InstancePaths.webhooks_list); + }} + onBack={() => { + route(InstancePaths.webhooks_list); + }} + /> + {/** * Templates pages */} <Route |