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

fixes

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