add color and routing

This commit is contained in:
2025-06-01 11:43:00 +02:00
parent 03e4a5790a
commit 87865871df
7 changed files with 93 additions and 22 deletions
+11 -3
View File
@@ -10,10 +10,18 @@
<script setup lang="ts">
import QuestionResult from '~/components/QuestionResult.vue';
const { data, error } = await useFetch<{ [question_id: string]: { [values: string]: number } }>('http://localhost:3000/results/beautifulAccessCode', {
const runtimeConfig = useRuntimeConfig()
const route = useRoute()
const { data, error } = await useFetch<{ [question_id: string]: { [values: string]: number } }>(`${runtimeConfig.public.apiBase}/results/${route.query.code}`, {
})
if (error) {
console.log(error.value)
if (error && error.value) {
throw createError({
statusCode: error.value.statusCode,
statusMessage: error.value.statusMessage,
message: error.value.data.message
});
}
</script>