19 lines
518 B
JavaScript
19 lines
518 B
JavaScript
export default defineEventHandler(async (event) => {
|
|
const { public: { apiBase } } = useRuntimeConfig();
|
|
const token = getCookie(event, 'token');
|
|
try {
|
|
const payments = await $fetch(`${apiBase}/user/payments`, {
|
|
method: 'GET',
|
|
headers: {
|
|
'Accept': 'application/json',
|
|
'Authorization': `Bearer ${token}`
|
|
},
|
|
});
|
|
console.log('server', payments);
|
|
return payments;
|
|
} catch (error) {
|
|
|
|
return error;
|
|
}
|
|
|
|
}) |