Add content creation

This commit is contained in:
Jonathan Bourdon
2024-07-01 23:32:53 -04:00
parent 308e96c26b
commit d2d9366700
19 changed files with 530 additions and 360 deletions

View File

@@ -0,0 +1,37 @@
<template>
<div class="flex">
<ContentCard v-for="content in contents"
:content="content"
class="m-2 bg-red w-full">
</ContentCard>
</div>
</template>
<script setup>
import {useClient} from '@/plugins/api.js';
import {defineProps, onBeforeMount, ref} from 'vue';
import ContentCard from "./ContentCard.vue";
const props = defineProps({
creatorId: {
type: String,
required: true
}
});
const client = useClient();
const contents = ref();
onBeforeMount(async () => {
try {
const response = await client.get(`/api/contents/user/${props.creatorId}`)
contents.value = response.data
} catch (error) {
console.error("Failed to fetch posts", error);
}
})
</script>