Fix document block
This commit is contained in:
parent
aa67c2c8b7
commit
5ea9d09c1b
|
|
@ -1,11 +1,30 @@
|
|||
<script setup lang="ts">
|
||||
import MediaLink from "@/components/mediaLibrary/MediaLink.vue";
|
||||
import type { LearningContentDocumentList } from "@/types";
|
||||
import type {
|
||||
LearningContentDocumentList,
|
||||
MediaLibraryContentBlockValue,
|
||||
} from "@/types";
|
||||
import LearningContentSimpleLayout from "../layouts/LearningContentSimpleLayout.vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
import log from "loglevel";
|
||||
import { itGetCached } from "@/fetchHelpers";
|
||||
|
||||
const props = defineProps<{
|
||||
content: LearningContentDocumentList;
|
||||
}>();
|
||||
|
||||
type BlockDocument = {
|
||||
id: string;
|
||||
value: MediaLibraryContentBlockValue;
|
||||
};
|
||||
|
||||
const documents = ref<BlockDocument[]>([]);
|
||||
|
||||
onMounted(async () => {
|
||||
log.debug("DocumentListBlock mounted");
|
||||
const response = await itGetCached(`/api/course/page/${props.content.slug}/`);
|
||||
documents.value = response.documents;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -19,7 +38,7 @@ const props = defineProps<{
|
|||
<div>
|
||||
<ul class="border-t">
|
||||
<li
|
||||
v-for="item in content.documents"
|
||||
v-for="item in documents"
|
||||
:key="item.id"
|
||||
class="flex items-center justify-between border-b py-4"
|
||||
>
|
||||
|
|
|
|||
Loading…
Reference in New Issue