mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 15:58:38 +01:00
new selfhosted version
This commit is contained in:
@@ -1,34 +1,16 @@
|
||||
<script lang="ts" setup>
|
||||
<script setup lang="ts">
|
||||
|
||||
const { clear } = useUserSession();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const project_id = route.query.project_id;
|
||||
if (!project_id) throw Error('project_id is required');
|
||||
const res = await $fetch('/api/project/members/accept', {
|
||||
headers: useComputedHeaders({
|
||||
custom: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).value,
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ project_id })
|
||||
});
|
||||
router.push('/');
|
||||
} catch (ex) {
|
||||
console.error('ERROR');
|
||||
console.error(ex);
|
||||
alert('An error occurred');
|
||||
}
|
||||
await clear();
|
||||
router.push('/');
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
You will be redirected soon.
|
||||
<div class="flex flex-col items-center mt-[10vh]">
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user