Gwk-Cultural-Park/utils/wp-posts.ts
2024-09-07 08:40:25 +07:00

24 lines
534 B
TypeScript

import axios from 'axios'
//MonthlyReleasePosts
export async function MonthlyReleasePostsData() {
const response = await axios.get(
'https://cmswp.gwkbali.com/wp-json/wp/v2/monthly-release'
) //
return response.data
}
//
const whatsnewfetchdata = async (url) => {
try {
const response = await axios.get(url)
return response.data
console.log(response.data)
} catch (error) {
console.error('Error fetching data:', error)
throw new Error('Error fetching data')
}
}
export default whatsnewfetchdata