| 1 |
import apiFetch from '@wordpress/api-fetch'; |
| 2 |
|
| 3 |
// variation here should be added to the payload by the custom component |
| 4 |
const id = window.extSharedData.globalStylesPostID; |
| 5 |
export default ({ variation }) => |
| 6 |
apiFetch({ |
| 7 |
method: 'POST', |
| 8 |
path: `/wp/v2/global-styles/${id}`, |
| 9 |
data: { |
| 10 |
id, |
| 11 |
settings: variation.settings, |
| 12 |
styles: variation.styles, |
| 13 |
}, |
| 14 |
}); |
| 15 |
|