fix: proper error message - resolved #2143

This commit is contained in:
liyasthomas
2022-03-02 00:10:05 +05:30
parent a0a26afd90
commit 6e59ae6424
31 changed files with 69 additions and 5 deletions

View File

@@ -378,8 +378,10 @@ export default defineComponent({
teamID: this.collectionsType.selectedTeam.id,
})().then((result) => {
if (E.isLeft(result)) {
this.$toast.error(this.$t("error.something_went_wrong"))
console.error(e)
if (result.left.error === "team_coll/short_title")
this.$toast.error(this.$t("collection.name_length_insufficient"))
else this.$toast.error(this.$t("error.something_went_wrong"))
console.error(result.left.error)
} else {
this.$toast.success(this.$t("collection.created"))
}
@@ -520,8 +522,10 @@ export default defineComponent({
collectionID: folder.id,
})().then((result) => {
if (E.isLeft(result)) {
this.$toast.error(this.$t("error.something_went_wrong"))
console.error(e)
if (result.left.error === "team_coll/short_title")
this.$toast.error(this.$t("folder.name_length_insufficient"))
else this.$toast.error(this.$t("error.something_went_wrong"))
console.error(result.left.error)
} else {
this.$toast.success(this.$t("folder.created"))
this.$emit("update-team-collections")