add image to the worker descriptor
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Pau 2022-11-22 14:39:35 +01:00
parent f5f47f4994
commit cd5bd180af
1 changed files with 5 additions and 3 deletions

View File

@ -2,6 +2,7 @@
import { onMounted, computed, ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useSession } from 'src/composables/useSession';
import axios from 'axios';
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
@ -18,8 +19,8 @@ onMounted(async () => {
});
const route = useRoute();
const { t } = useI18n();
const { getToken } = useSession();
const entityId = computed(() => {
return $props.id || route.params.id;
@ -67,13 +68,14 @@ function sipExtension() {
}
function getWorkerAvatar() {
return `/api/Images/user/160x160/${worker.value.user.id}/download`;
const token = getToken();
return `/api/Images/user/160x160/${worker.value.user.id}/download?access_token=${token}`;
}
</script>
<template>
<card-descriptor v-if="worker" module="Worker" :data="worker" :description="worker.user.nickname">
<template #body>
<q-img :src="getWorkerAvatar()" class="q-mb-md" style="width: 100px; height: 100px" />
<q-img :src="getWorkerAvatar()" class="q-mb-md" />
<q-list>
<q-item>
<q-item-section side>