diff --git a/src/components/admin.js b/src/components/admin.js index 88f1257..03b83fb 100644 --- a/src/components/admin.js +++ b/src/components/admin.js @@ -29,9 +29,6 @@ export default { this.users = response.data.users } }) - .catch((error) => { - console.error(error.response) - }) }, getCurrentUser () { this.$http.get('/users/current') @@ -40,9 +37,6 @@ export default { this.currentUser = response.data.user } }) - .catch((error) => { - console.error(error.response) - }) }, updateUserAdmin (id, isAdmin) { this.$http.patch('/users/admin/'.concat(id), { @@ -53,8 +47,7 @@ export default { this.updateText = 'User updated' } }) - .catch(function (error) { - console.error(error.response) + .catch(() => { this.updateText = 'Error updating user' }) }, @@ -67,8 +60,7 @@ export default { this.updateText = 'User updated' } }) - .catch(function (error) { - console.error(error.response) + .catch(() => { this.updateText = 'Error updating user' }) }, @@ -79,9 +71,6 @@ export default { this.getUsers() } }) - .catch((error) => { - console.error(error.response) - }) }, registerUser () { this.$http.post('/users', { @@ -100,9 +89,6 @@ export default { this.getUsers() } }) - .catch((error) => { - console.error(error.response) - }) } } } diff --git a/src/components/appbar.js b/src/components/appbar.js index 188a874..b1cc659 100644 --- a/src/components/appbar.js +++ b/src/components/appbar.js @@ -20,9 +20,6 @@ export default { this.$router.push('/login') } }) - .catch((error) => { - console.error(error.response) - }) }, getCurrentUser () { this.loggedIn = false @@ -35,8 +32,7 @@ export default { this.$vuetify.theme.dark = response.data.user.darkMode } }) - .catch((error) => { - console.error(error.response) + .catch(() => { this.isAdmin = false }) }, @@ -44,9 +40,6 @@ export default { this.$http.patch('/users/dark-mode', { darkMode: this.$vuetify.theme.dark }) - .catch((error) => { - console.error(error.response) - }) } } } diff --git a/src/components/login.js b/src/components/login.js index e6027df..60b53f6 100644 --- a/src/components/login.js +++ b/src/components/login.js @@ -25,10 +25,11 @@ export default { }) .catch((error) => { if (error.response.status === 401) { - this.snackbar = true this.snackbarText = 'Login Failed: Unauthorized' + } else { + this.snackbarText = 'Login Failed' } - console.error(error.response) + this.snackbar = true }) } } diff --git a/src/components/noise.js b/src/components/noise.js index 6eaf30c..b0cb710 100644 --- a/src/components/noise.js +++ b/src/components/noise.js @@ -216,9 +216,6 @@ export default { } } }) - .catch((error) => { - console.error(error.response) - }) }, addDefaultProfile () { this.$http.post('/profiles/default') @@ -229,9 +226,6 @@ export default { this.selectedProfile = defaultProfile } }) - .catch((error) => { - console.error(error.response) - }) }, saveProfile () { this.$http.post('/profiles', { @@ -259,8 +253,7 @@ export default { this.infoSnackbar = true } }) - .catch((error) => { - console.error(error.response) + .catch(() => { this.errorSnackbarText = 'Error Saving Profile' this.errorSnackbar = true }) @@ -288,8 +281,7 @@ export default { this.infoSnackbar = true } }) - .catch((error) => { - console.error(error.response) + .catch(() => { this.errorSnackbarText = 'Error Saving Profile' this.errorSnackbar = true }) @@ -318,9 +310,6 @@ export default { this.loadedSamples = profile.samples } }) - .catch((error) => { - console.error(error.response) - }) }, deleteProfile () { this.$http.delete('/profiles/'.concat(this.selectedProfile.id)) @@ -331,8 +320,7 @@ export default { this.infoSnackbar = true } }) - .catch((error) => { - console.error(error.response) + .catch(() => { this.errorSnackbarText = 'Error Deleting Profile' this.errorSnackbar = true }) @@ -349,9 +337,6 @@ export default { }) } }) - .catch((error) => { - console.error(error) - }) }, uploadSample () { const formData = new FormData() @@ -374,9 +359,10 @@ export default { .catch((error) => { if (error.response.status === 409) { this.errorSnackbarText = 'Error Uploading Sample: Duplicate Sample Name' - this.errorSnackbar = true + } else { + this.errorSnackbarText = 'Error Uploading Sample' } - console.error(error.response) + this.errorSnackbar = true }) this.uploadSampleDialog = false @@ -406,9 +392,6 @@ export default { this.$vuetify.theme.dark = response.data.user.darkMode } }) - .catch((error) => { - console.error(error.response) - }) } } } diff --git a/src/components/register.js b/src/components/register.js index 14c3094..c5141a5 100644 --- a/src/components/register.js +++ b/src/components/register.js @@ -23,9 +23,6 @@ export default { this.$router.push('/login') } }) - .catch((error) => { - console.error(error.response) - }) } } }