Show crew on event cards when logged in as crew
This commit is contained in:
parent
529d640a0e
commit
89b1d2a547
2 changed files with 7 additions and 0 deletions
|
@ -31,6 +31,10 @@
|
||||||
<template v-if="slot.interested">
|
<template v-if="slot.interested">
|
||||||
({{ slot.interested }} interested)
|
({{ slot.interested }} interested)
|
||||||
</template>
|
</template>
|
||||||
|
<p v-if="slot.assigned">
|
||||||
|
Crew:
|
||||||
|
{{ slot.assigned.map(id => idToAccount.get(id)?.name).join(", ") }}
|
||||||
|
</p>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
@ -48,6 +52,8 @@ const runtimeConfig = useRuntimeConfig();
|
||||||
const { data: session, refresh: refreshSession } = await useAccountSession();
|
const { data: session, refresh: refreshSession } = await useAccountSession();
|
||||||
const interestedIds = computed(() => new Set(session.value?.account.interestedIds ?? []));
|
const interestedIds = computed(() => new Set(session.value?.account.interestedIds ?? []));
|
||||||
const timezone = computed(() => session.value?.account?.timezone ?? runtimeConfig.public.defaultTimezone);
|
const timezone = computed(() => session.value?.account?.timezone ?? runtimeConfig.public.defaultTimezone);
|
||||||
|
const { data: accounts } = await useAccounts();
|
||||||
|
const idToAccount = computed(() => new Map(accounts.value?.map(a => [a.id, a])));
|
||||||
|
|
||||||
function formatTime(time: string) {
|
function formatTime(time: string) {
|
||||||
return DateTime.fromISO(time, { zone: timezone.value }).toFormat("yyyy-LL-dd HH:mm");
|
return DateTime.fromISO(time, { zone: timezone.value }).toFormat("yyyy-LL-dd HH:mm");
|
||||||
|
|
|
@ -5,5 +5,6 @@ export const useAccounts = () => useFetch(
|
||||||
getCachedData(key, nuxtApp) {
|
getCachedData(key, nuxtApp) {
|
||||||
return nuxtApp.payload.data[key];
|
return nuxtApp.payload.data[key];
|
||||||
},
|
},
|
||||||
|
dedupe: "defer",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue