| 1 |
import apiFetch from '@wordpress/api-fetch'; |
| 2 |
|
| 3 |
export const updateOption = async (option, value) => { |
| 4 |
await apiFetch({ |
| 5 |
path: '/extendify/v1/agent/options', |
| 6 |
method: 'post', |
| 7 |
data: { option, value }, |
| 8 |
}); |
| 9 |
}; |
| 10 |
|
| 11 |
export const getOption = (option) => { |
| 12 |
const params = new URLSearchParams({ option: String(option) }); |
| 13 |
return apiFetch({ |
| 14 |
path: `/extendify/v1/agent/options?${params.toString()}`, |
| 15 |
method: 'GET', |
| 16 |
}); |
| 17 |
}; |
| 18 |
|