| 1 |
import axios from "axios"; |
| 2 |
|
| 3 |
const useGetChangeLogData = () => { |
| 4 |
const getChangeLog = async () => { |
| 5 |
const data = new FormData(); |
| 6 |
data.append("nonce", sp_pcp_block_settings.nonce); |
| 7 |
data.append("action", "sp_smart_post_block_changelog"); |
| 8 |
try { |
| 9 |
const response = await axios.post(ajaxurl, data); |
| 10 |
return response.data; |
| 11 |
} catch (error) { |
| 12 |
// console.error("Error fetching posts:", error.message); |
| 13 |
throw error; |
| 14 |
} |
| 15 |
}; |
| 16 |
|
| 17 |
return { getChangeLog: getChangeLog }; |
| 18 |
}; |
| 19 |
|
| 20 |
export default useGetChangeLogData; |
| 21 |
|