entities-admin.ts
53 lines
| 1 | import {__} from '@wordpress/i18n'; |
| 2 | import {dispatch} from '@wordpress/data'; |
| 3 | import {store as coreStore} from '@wordpress/core-data'; |
| 4 | |
| 5 | //@ts-ignore |
| 6 | dispatch(coreStore).addEntities([ |
| 7 | { |
| 8 | name: 'campaign', |
| 9 | kind: 'givewp', |
| 10 | baseURL: '/givewp/v3/campaigns', |
| 11 | baseURLParams: {}, |
| 12 | plural: 'campaigns', |
| 13 | label: __('Campaign', 'give'), |
| 14 | supportsPagination: true, |
| 15 | }, |
| 16 | { |
| 17 | name: 'donation', |
| 18 | kind: 'givewp', |
| 19 | baseURL: '/givewp/v3/donations', |
| 20 | baseURLParams: {includeSensitiveData: true, anonymousDonations: 'include', _embed: true}, |
| 21 | plural: 'donations', |
| 22 | label: __('Donation', 'give'), |
| 23 | supportsPagination: true, |
| 24 | }, |
| 25 | { |
| 26 | name: 'donor', |
| 27 | kind: 'givewp', |
| 28 | baseURL: '/givewp/v3/donors', |
| 29 | baseURLParams: {includeSensitiveData: true, anonymousDonors: 'include'}, |
| 30 | plural: 'donors', |
| 31 | label: __('Donor', 'give'), |
| 32 | supportsPagination: true, |
| 33 | }, |
| 34 | { |
| 35 | name: 'subscription', |
| 36 | kind: 'givewp', |
| 37 | baseURL: '/givewp/v3/subscriptions', |
| 38 | baseURLParams: {_embed: true, includeSensitiveData: true, anonymousDonors: 'include'}, |
| 39 | plural: 'subscriptions', |
| 40 | label: __('Subscription', 'give'), |
| 41 | supportsPagination: true, |
| 42 | }, |
| 43 | { |
| 44 | name: 'form', |
| 45 | kind: 'givewp', |
| 46 | baseURL: '/givewp/v3/forms', |
| 47 | baseURLParams: {}, |
| 48 | plural: 'forms', |
| 49 | label: __('Donation Form', 'give'), |
| 50 | supportsPagination: true, |
| 51 | }, |
| 52 | ]); |
| 53 |