Skip to content

Commit

Permalink
Fix FoldMason example
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Aug 3, 2024
1 parent 3357e2c commit 9d1222e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions frontend/FoldMasonSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 9d1222e

Please sign in to comment.