From 9d1222e6417760f7b00ae494d45ca77fd07eddce Mon Sep 17 00:00:00 2001 From: Milot Mirdita Date: Sat, 3 Aug 2024 15:06:15 +0900 Subject: [PATCH] Fix FoldMason example --- frontend/FoldMasonSearch.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/FoldMasonSearch.vue b/frontend/FoldMasonSearch.vue index 6ab6edb..82943ec 100644 --- a/frontend/FoldMasonSearch.vue +++ b/frontend/FoldMasonSearch.vue @@ -166,19 +166,19 @@ export default { }, methods: { async handleLoadExample() { - const url = "https://search.foldseek.com/dl/foldmason_example.json"; + let response = null; try { - const response = await this.$axios.get(url); - if (!response.ok) { + const url = "https://search.foldseek.com/dl/foldmason_example.json"; + response = await this.$axios.get(url); + if (!response) { throw new Error(`Error fetching example: ${response.status}`); } } catch (error) { this.errorMessage = "Error loading example"; throw error; - } finally { - this.$root.userData = await JSON.parse(response.data); - this.$router.push({ name: 'foldmasonresult', params: { ticket: `ticket-example` }}).catch(error => {}); } + this.$root.userData = response.data; + this.$router.push({ name: 'foldmasonresult', params: { ticket: `user-example` }}).catch(error => {}); }, async search() { var request = {