Files
dlearn-front/server/api/course.js
T
HAM!DREZA 2242ed022f update
2024-05-31 00:03:10 +03:30

33 lines
732 B
JavaScript

export default defineEventHandler(async (event) => {
const { public: { apiBase } } = useRuntimeConfig();
const body = await readBody(event);
console.log(body);
try {
const data = await $fetch(`${apiBase}/course${body.changeCategory}`, {
method: 'GET',
headers: {
'Accept': 'application/json',
}
});
return data;
} catch (error) {
return error;
}
})
// const page = ref(0);
// const { data, refresh } = await useFetch(() => '/api/global', {
// query: { url: '/orders', page },
// headers: useRequestHeaders(['cookie'])
// })
// function paginate(value) {
// page.value = value;
// refresh()
// }