Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
refactor: better error prompts
liyasthomasd5c5fb743566
diff --git a/components/teams/Edit.vue b/components/teams/Edit.vueindex 72c267dce..aaa7ed636 100644--- a/components/teams/Edit.vue+++ b/components/teams/Edit.vue@@ -312,13 +312,26 @@ export default {})return}+ let invalidEmail = falsethis.$data.newMembers.forEach((element) => {if (!this.validateEmail(element.key)) {this.$toast.error(this.$t("invalid_emailID_format"), {icon: "error",})+ invalidEmail = true}})+ if (invalidEmail) return+ let invalidPermission = false+ this.$data.newMembers.forEach((element) => {+ if (!element.value) {+ this.$toast.error(this.$t("invalid_member_permission"), {+ icon: "error",+ })+ invalidPermission = true+ }+ })+ if (invalidPermission) returnthis.$data.newMembers.forEach((element) => {// Call to the graphql mutationteamUtils@@ -333,17 +346,15 @@ export default {this.$toast.success(this.$t("team_saved"), {icon: "done",})- this.hideModal()}).catch((error) => {// Error- this.$toast.error(this.$t("error_occurred"), {+ this.$toast.error(error, {icon: "done",})console.error(error)})})- let messageShown = truethis.members.forEach((element) => {teamUtils.updateTeamMemberRole(@@ -354,22 +365,15 @@ export default {).then(() => {// Result- if (messageShown) {- this.$toast.success(this.$t("role_updated"), {- icon: "done",- })- messageShown = false- }- this.hideModal()+ this.$toast.success(this.$t("role_updated"), {+ icon: "done",+ })}).catch((error) => {// Error- if (messageShown) {- this.$toast.error(this.$t("error_occurred"), {- icon: "done",- })- messageShown = false- }+ this.$toast.error(error, {+ icon: "done",+ })console.error(error)})})@@ -389,7 +393,6 @@ export default {this.$toast.success(this.$t("team_saved"), {icon: "done",})- this.hideModal()}).catch((error) => {// Errordiff --git a/lang/en-US.json b/lang/en-US.jsonindex 68feb25e8..4130f88df 100644--- a/lang/en-US.json+++ b/lang/en-US.json@@ -315,6 +315,7 @@"use_team": "Use Team","add_one_member": "(add at least one member)","permissions": "Permissions",+ "invalid_member_permission": "Please provide a valid permission to the team member","email": "E-mail","create_new_team": "Create new team","new_team_created": "New team created",