We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d61335f commit 4eaa241Copy full SHA for 4eaa241
1 file changed
packages/app/app/components/Commits.vue
@@ -12,18 +12,22 @@ const props = defineProps<{
12
repo: string;
13
}>();
14
15
-const data = await $fetch("/api/repo/commits", {
16
- query: {
17
- owner: props.owner,
18
- repo: props.repo,
19
- },
20
-});
+const { data } = await useAsyncData(
+ `repo-commits:${props.owner}:${props.repo}:page:1`,
+ () =>
+ $fetch("/api/repo/commits", {
+ query: {
+ owner: props.owner,
21
+ repo: props.repo,
22
+ },
23
+ }),
24
+);
25
-if (!data) {
26
+if (!data.value) {
27
throw createError("Could not load Commits");
28
}
29
-const branch = shallowReactive(data);
30
+const branch = shallowReactive(data.value);
31
32
const commitsWithRelease = computed(() =>
33
branch.target.history.nodes
0 commit comments