Skip to content

Commit

Permalink
message rather than error if no family
Browse files Browse the repository at this point in the history
  • Loading branch information
Dropheart committed Sep 29, 2024
1 parent c8c4545 commit 9434353
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/pages/family.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts">
const headers = useRequestHeaders();
const { currentUser } = useAuth();
// TODO specify the type of data
const { data, status, error } = useFetch<any>('/api/family/myFamily', {
headers
Expand All @@ -15,6 +16,14 @@ definePageMeta({
<CardTitle>Your Family</CardTitle>

<div v-if="status == 'pending'">Loading...</div>
<div v-else-if="error?.statusCode == 400">
You do not have a family.
{{
currentUser!.role == 'fresher'
? "We'll let you know when your family has been allocated!"
: 'All you needed was a happy marriage :('
}}
</div>
<div v-else-if="status == 'error'">Oops... {{ error?.message }}</div>
<div v-else-if="status == 'success'">
<CardDetails>
Expand Down

0 comments on commit 9434353

Please sign in to comment.