create searchBox section

This commit is contained in:
HAM!DREZA
2024-06-10 13:18:04 +03:30
parent 5310ec4dbc
commit c8bfc3c177
22 changed files with 1124 additions and 596 deletions
+25
View File
@@ -0,0 +1,25 @@
export default defineEventHandler(async (event) => {
const { public: { apiBase } } = useRuntimeConfig();
const token = getCookie(event, 'token');
const body = await readBody(event);
const query = getQuery(event);
console.log('c s',body);
console.log(query);
try {
const data = await $fetch(`${apiBase}/course/${query.id}/comment`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Authorization': `Bearer ${token}`
},
body
});
console.log('ser com', data);
return data;
} catch (error) {
return error;
}
})