This commit is contained in:
HAM!DREZA
2024-06-19 21:03:07 +03:30
parent 3f9e0d7615
commit 607ead8528
20 changed files with 869 additions and 298 deletions
+22
View File
@@ -0,0 +1,22 @@
export default defineEventHandler(async (event) => {
const { public: { apiBase } } = useRuntimeConfig();
const token = getCookie(event, 'token');
const body = await readBody(event);
console.log(body);
try {
const data = await $fetch(`${apiBase}/courseHeadlineComment/create`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Authorization': `Bearer ${token}`
},
body
});
console.log(data);
return data;
} catch (error) {
return error;
}
})
+1 -3
View File
@@ -3,8 +3,6 @@ export default defineEventHandler(async (event) => {
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`, {
@@ -15,7 +13,7 @@ export default defineEventHandler(async (event) => {
},
body
});
console.log('ser com', data);
return data;
} catch (error) {