18 lines
573 B
Vue
18 lines
573 B
Vue
|
<script lang="ts" setup>
|
||
|
import { IReview } from "~/models/stories/review";
|
||
|
import singleReview from "./singleReview.vue";
|
||
|
import { SingleChapterResult } from "~/lib/client/types/slightlyDifferentStory";
|
||
|
const props = defineProps<{ endpoint: string }>();
|
||
|
const story = inject<SingleChapterResult>("story");
|
||
|
const { data: reviews } = (await useApiFetch<IReview[]>(
|
||
|
`${props.endpoint}/reviews`,
|
||
|
)) as unknown as {
|
||
|
data: IReview[];
|
||
|
};
|
||
|
</script>
|
||
|
<template>
|
||
|
<div v-for="comment in reviews">
|
||
|
<single-review :review="comment" :story="story!" />
|
||
|
</div>
|
||
|
</template>
|