2023-12-06 21:42:04 -05:00
|
|
|
<script lang="ts" setup>
|
2023-12-20 17:23:31 -05:00
|
|
|
import { IReview } from "@models/stories/review";
|
2023-12-06 21:42:04 -05:00
|
|
|
import singleReview from "./singleReview.vue";
|
2023-12-20 17:23:31 -05:00
|
|
|
import { SingleChapterResult } from "@client/types/slightlyDifferentStory";
|
2023-12-06 21:42:04 -05:00
|
|
|
const props = defineProps<{ endpoint: string }>();
|
|
|
|
const story = inject<SingleChapterResult>("story");
|
2023-12-29 20:53:29 -05:00
|
|
|
const { data: reviews } = (await useApiFetch<IReview[]>(`${props.endpoint}/reviews`)) as unknown as {
|
2023-12-06 21:42:04 -05:00
|
|
|
data: IReview[];
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<template>
|
|
|
|
<div v-for="comment in reviews">
|
|
|
|
<single-review :review="comment" :story="story!" />
|
|
|
|
</div>
|
|
|
|
</template>
|