Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
simlarsen committed Nov 18, 2023
2 parents 3bdc740 + 784bebe commit b0eb75d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
30 changes: 18 additions & 12 deletions Dashboard/src/Pages/Settings/Invoices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

Expand All @@ -38,18 +39,23 @@ const Settings: FunctionComponent<ComponentProps> = (
try {
setIsLoading(true);

await BaseAPI.post<JSONObject>(
URL.fromString(DASHBOARD_API_URL.toString()).addRoute(
`/billing-invoices/pay`
),
{
data: {
paymentProviderInvoiceId: invoiceId,
paymentProviderCustomerId: customerId,
const result: HTTPResponse<JSONObject> =
await BaseAPI.post<JSONObject>(
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) {
Expand Down Expand Up @@ -220,7 +226,7 @@ const Settings: FunctionComponent<ComponentProps> = (

{error ? (
<ConfirmModal
title={`Error`}
title={`Something is not quite right...`}
description={`${error}`}
submitButtonText={'Close'}
onSubmit={() => {
Expand Down
2 changes: 1 addition & 1 deletion Model/Models/StatusPageAnnouncement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
4 changes: 2 additions & 2 deletions Model/Models/StatusPageGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit b0eb75d

Please sign in to comment.