publication v-1

This commit is contained in:
HAM!DREZA
2024-07-03 14:34:21 +03:30
parent d2f71b6b14
commit 1518075cc6
21 changed files with 247 additions and 185 deletions
+2 -4
View File
@@ -1,18 +1,16 @@
export default defineEventHandler(async (event) => {
const { public: { apiBase } } = useRuntimeConfig();
const body = await readBody(event);
const token = getCookie(event, 'token');
const query = getQuery(event);
try {
const data = await $fetch(`${apiBase}/course/${body.id}?userId=${body.userId}`, {
const data = await $fetch(`${apiBase}/course/${query.id}?userId=${query.userId}`, {
headers: {
'Accept': 'application/json',
'Authorization': `Bearer ${token}`
},
});
return data;
} catch (error) {