Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs authored Sep 26, 2024
1 parent d0f8042 commit 4801d49
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion webapp/src/components/CollectionSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ export default {
if (this.searchQuery && !/^[a-zA-Z0-9_-]+$/.test(this.searchQuery)) {
return "ID can only contain alphanumeric characters, dashes ('-'), and underscores ('_').";
}
if (/^[._-]/.test(this.searchQuery) | /[._-]$/.test(this.searchQuery)) {
return "ID cannot start or end with punctuation";
}
if ((this.searchQuery && this.searchQuery.length < 1) || this.searchQuery.length > 40) {
return "ID must be between 1 and 40 characters.";
}
Expand All @@ -152,7 +155,7 @@ export default {
}
} catch (error) {
console.error("Error:", error);
alert("An error occurred while creating the collection. Please try again.");
alert("An error occurred while creating the collection. Please check that your desired collection ID is valid.");
}
}
},
Expand Down

0 comments on commit 4801d49

Please sign in to comment.