api / tickets
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
})
|
||||
Reference in New Issue
Block a user