give
/
src
/
Subscriptions
/
resources
/
admin
/
components
/
SubscriptionDetailsPage
/
Tabs
/
Donations
/
apiSettings.ts
give
/
src
/
Subscriptions
/
resources
/
admin
/
components
/
SubscriptionDetailsPage
/
Tabs
/
Donations
Last commit date
AddRenewalModal
10 months ago
apiSettings.ts
10 months ago
index.tsx
10 months ago
styles.module.scss
10 months ago
apiSettings.ts
54 lines
| 1 | import { getSubscriptionOptionsWindowData } from "@givewp/subscriptions/utils"; |
| 2 | |
| 3 | const { legacyApiRoot, apiNonce } = getSubscriptionOptionsWindowData(); |
| 4 | const urlParams = new URLSearchParams(window.location.search); |
| 5 | const subscriptionId = urlParams.get('id'); |
| 6 | |
| 7 | const apiSettings = { |
| 8 | apiRoot: `${legacyApiRoot}/donations?subscriptionId=${subscriptionId}`, |
| 9 | apiNonce, |
| 10 | table: { |
| 11 | columns: [ |
| 12 | { |
| 13 | id: 'id', |
| 14 | label: 'ID', |
| 15 | sortable: true, |
| 16 | visible: true, |
| 17 | }, |
| 18 | { |
| 19 | id: 'subscriptionDonationType', |
| 20 | label: 'Type', |
| 21 | sortable: false, |
| 22 | visible: true, |
| 23 | }, |
| 24 | { |
| 25 | id: 'campaign', |
| 26 | label: 'Campaign', |
| 27 | sortable: false, |
| 28 | visible: true, |
| 29 | }, |
| 30 | { |
| 31 | id: 'createdAt', |
| 32 | label: 'Date', |
| 33 | sortable: true, |
| 34 | visible: true, |
| 35 | }, |
| 36 | { |
| 37 | id: 'status', |
| 38 | label: 'Status', |
| 39 | sortable: false, |
| 40 | visible: true, |
| 41 | }, |
| 42 | { |
| 43 | id: 'amount', |
| 44 | label: 'Amount', |
| 45 | sortable: true, |
| 46 | visible: true, |
| 47 | }, |
| 48 | ], |
| 49 | id: 'donations', |
| 50 | }, |
| 51 | }; |
| 52 | |
| 53 | export default apiSettings; |
| 54 |