Add WIP for content and creators

This commit is contained in:
Jonathan Bourdon
2024-07-02 04:30:46 -04:00
parent cb02cce5b4
commit 473cc072c8
6 changed files with 191 additions and 95 deletions

View File

@@ -10,7 +10,7 @@
</v-img>
<iframe v-if="isHttpUrl"
:src="props.content.banner"
:src="props?.content?.uri"
title="YouTube video player"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
@@ -19,8 +19,11 @@
</div>
<div class="text-lg font-bold">{{ props.content.title }}</div>
<div class="text-sm text-gray-500">{{ props.content.title }}</div>
<router-link :to="'content/' + props?.content?.id">
<div class="text-lg font-bold">{{ props.content.title }}</div>
<div class="text-sm text-gray-500">{{ props.content.description }}</div>
</router-link>
</div>
@@ -30,7 +33,7 @@
import {defineProps, computed} from 'vue';
const isHttpUrl = computed(() => props.content.url.startsWith('http'))
const isHttpUrl = computed(() => props.content?.uri?.startsWith('http'))
const props = defineProps({
content: {

View File

@@ -27,11 +27,11 @@ const contents = ref();
onBeforeMount(async () => {
if (props.creatorId == null) return
try {
const response = await client.get(`/api/contents/user/${props.creatorId}`)
if (response.status >= 200 && response.status < 300) {
if (response.status >= 200 && response.status < 300) {
contents.value = response.data
console.table(contents.value)
}
} catch (error) {
console.error("Failed to fetch posts", error);