api / tickets

This commit is contained in:
HAM!DREZA
2024-05-29 22:31:05 +03:30
parent 1e132b97db
commit fd5b06c2d7
20 changed files with 810 additions and 179 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);
try {
const data = await $fetch(`${apiBase}/ticket`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Authorization': `Bearer ${token}`
},
body
});
return data;
} catch (error) {
return error;
}
})