Skip to content
Snippets Groups Projects
Commit 2287d8bb authored by simon.mellerin's avatar simon.mellerin
Browse files

Merge branch 'fixes' into 'main'

fixes

See merge request !14
parents a5559c21 825f8098
No related branches found
No related tags found
1 merge request!14fixes
Pipeline #10152 passed
......@@ -15,6 +15,7 @@ import { computed, type PropType } from 'vue';
import { type OcCommunity } from '../../declarations';
import OcLink from '@/components/OcLink.vue';
import { useTranslateValue } from '@/composables/translateValue';
import { useI18n } from 'vue-i18n';
const props = defineProps({
community: {
......@@ -23,6 +24,7 @@ const props = defineProps({
}
})
const { t } = useI18n()
const { translateValue } = useTranslateValue()
const title = computed(() => translateValue(props.community.title))
......
......@@ -7,8 +7,8 @@ export function httpFetch(
url: string,
options?: {
method?: 'HEAD' | 'GET' | 'POST',
headers?: HeadersInit,
body?: BodyInit | null,
headers?: Record<string, string>,
body?: Document,
auth?: Credentials,
}
): Promise<HttpResponse> {
......
......@@ -42,7 +42,7 @@ import { useRouter } from 'vue-router';
const accountStore = useAccountStore()
const router = useRouter()
const { t } = useI18n()
const { t, locale } = useI18n()
const loginError = ref(false)
......
......@@ -6,6 +6,7 @@ import {
import { routes } from 'vue-router/auto-routes'
import { useAccountStore } from './stores/account'
import { getProfileInfos } from './sparql/connection'
import type { Credentials } from './declarations'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL ?? ''),
......@@ -55,7 +56,7 @@ router.beforeEach(async () => {
const accountStore = useAccountStore()
if (accountStore.isAuthenticated && accountStore.profile === null) {
const { infos, profile } = await getProfileInfos(accountStore.auth)
const { infos, profile } = await getProfileInfos(accountStore.auth as Credentials)
accountStore.profile = profile
accountStore.infos = infos
......
......@@ -6,10 +6,11 @@ interface AccountState {
auth?: Credentials
infos: OcMemberInfos | null
profile: OcPerson | null
isAuthenticated: bool
}
export const useAccountStore = defineStore<string, AccountState>('account', () => {
const auth = ref()
const auth = ref<Credentials>()
const localAuth = localStorage.getItem('token')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment