This commit is contained in:
HAM!DREZA
2024-05-31 00:03:10 +03:30
parent fd5b06c2d7
commit 2242ed022f
17 changed files with 379 additions and 96 deletions
+23
View File
@@ -0,0 +1,23 @@
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}/ticket`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Authorization': `Bearer ${token}`
},
body,
});
return data;
} catch (error) {
return error;
}
})