Skip to content

Commit

Permalink
fixed dynamic paths to achievement pics
Browse files Browse the repository at this point in the history
  • Loading branch information
BatuevIO committed Sep 8, 2024
1 parent 7e8082c commit a7271df
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
8 changes: 3 additions & 5 deletions src/views/admin/achievement/AchievementRecieversView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,16 @@ const give = (user_id: number | undefined) => {
})
.then(async () => achievement.value?.recievers?.unshift({ user_id }));
};
const picPath = import.meta.env.VITE_API_URL + '/achievement/';
</script>

<template>
<IrdomLayout>
<AccessRestricted :scope="scopename.achievements.achievement.create">
<v-row class="row" align-content="stretch">
<v-card>
<img
:src="import.meta.env.VITE_API_URL + '/achievement/' + achievement?.picture"
width="100"
height="100"
/>
<img :src="picPath + achievement?.picture" width="100" height="100" />
<div>
<h2>{{ achievement?.name }}</h2>
<p>{{ achievement?.description }}</p>
Expand Down
8 changes: 3 additions & 5 deletions src/views/admin/achievement/AchievementRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,15 @@ const save = (id: number, name: string, description: string) => {
})
.then(() => (formUpdatedValue.value = false));
};
const picPath = import.meta.env.VITE_API_URL + '/achievement/';
</script>

<template>
<tr key="id" class="row">
<td>{{ props.achievement.id }}</td>
<td>
<img
:src="import.meta.env.VITE_API_URL + '/achievement/' + props.achievement.picture"
height="50"
width="50"
/>
<img :src="picPath + props.achievement.picture" height="50" width="50" />
</td>
<td>
<v-text-field v-model="name" variant="underlined" />
Expand Down
8 changes: 3 additions & 5 deletions src/views/profile/achievement/AchievementsSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ onMounted(async () => {
}
});
});
const picPath = import.meta.env.VITE_API_URL + '/achievement/';
</script>

<template>
<v-slide-group v-if="achievements.length > 0">
<v-slide-group-item v-for="{ id, name, description, picture } in achievements" :key="id">
<AchievementElement
:name="name"
:description="description"
:picture="import.meta.env.VITE_API_URL + '/achievement/' + picture"
/>
<AchievementElement :name="name" :description="description" :picture="picPath + picture" />
</v-slide-group-item>
</v-slide-group>
<div v-else-if="!isLoaded">
Expand Down

0 comments on commit a7271df

Please sign in to comment.