diff --git a/Dashboard/src/Pages/Settings/Invoices.tsx b/Dashboard/src/Pages/Settings/Invoices.tsx index b4557693aeb..7232d887358 100644 --- a/Dashboard/src/Pages/Settings/Invoices.tsx +++ b/Dashboard/src/Pages/Settings/Invoices.tsx @@ -22,6 +22,7 @@ import ModelAPI from 'CommonUI/src/Utils/ModelAPI/ModelAPI'; import ConfirmModal from 'CommonUI/src/Components/Modal/ConfirmModal'; import ComponentLoader from 'CommonUI/src/Components/ComponentLoader/ComponentLoader'; import DashboardNavigation from '../../Utils/Navigation'; +import HTTPResponse from 'Common/Types/API/HTTPResponse'; export interface ComponentProps extends PageComponentProps {} @@ -38,18 +39,23 @@ const Settings: FunctionComponent = ( try { setIsLoading(true); - await BaseAPI.post( - URL.fromString(DASHBOARD_API_URL.toString()).addRoute( - `/billing-invoices/pay` - ), - { - data: { - paymentProviderInvoiceId: invoiceId, - paymentProviderCustomerId: customerId, + const result: HTTPResponse = + await BaseAPI.post( + URL.fromString(DASHBOARD_API_URL.toString()).addRoute( + `/billing-invoices/pay` + ), + { + data: { + paymentProviderInvoiceId: invoiceId, + paymentProviderCustomerId: customerId, + }, }, - }, - ModelAPI.getCommonHeaders() - ); + ModelAPI.getCommonHeaders() + ); + + if (result.isFailure()) { + throw result; + } Navigation.reload(); } catch (err) { @@ -220,7 +226,7 @@ const Settings: FunctionComponent = ( {error ? ( { diff --git a/Model/Models/StatusPageAnnouncement.ts b/Model/Models/StatusPageAnnouncement.ts index f99c34af3a1..4947de1c4c5 100644 --- a/Model/Models/StatusPageAnnouncement.ts +++ b/Model/Models/StatusPageAnnouncement.ts @@ -38,7 +38,7 @@ import { PlanSelect } from 'Common/Types/Billing/SubscriptionPlan'; create: PlanSelect.Growth, read: PlanSelect.Free, update: PlanSelect.Growth, - delete: PlanSelect.Growth, + delete: PlanSelect.Free, }) @TableAccessControl({ create: [ diff --git a/Model/Models/StatusPageGroup.ts b/Model/Models/StatusPageGroup.ts index 09ee75d31cd..e353d89b96b 100644 --- a/Model/Models/StatusPageGroup.ts +++ b/Model/Models/StatusPageGroup.ts @@ -28,8 +28,8 @@ import { PlanSelect } from 'Common/Types/Billing/SubscriptionPlan'; @TableBillingAccessControl({ create: PlanSelect.Growth, read: PlanSelect.Free, - update: PlanSelect.Growth, - delete: PlanSelect.Growth, + update: PlanSelect.Free, + delete: PlanSelect.Free, }) @CanAccessIfCanReadOn('statusPage') @TenantColumn('projectId')