Skip to content

Commit e53d097

Browse files
committed
Fix linter and errors
1 parent b2e6123 commit e53d097

File tree

5 files changed

+32
-152
lines changed

5 files changed

+32
-152
lines changed

web/nuxt.config.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ export default {
7878

7979
// Modules: https://go.nuxtjs.dev/config-modules
8080
modules: [
81-
// https://go.nuxtjs.dev/axios
82-
'@nuxtjs/axios',
8381
// Simple usage
8482
'@nuxtjs/dotenv',
8583
[
@@ -118,12 +116,6 @@ export default {
118116
'@nuxtjs/sitemap', // always put it at the end
119117
],
120118

121-
// Axios module configuration: https://go.nuxtjs.dev/config-axios
122-
axios: {
123-
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
124-
baseURL: process.env.BASE_URL || 'http://localhost:8000',
125-
},
126-
127119
// Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
128120
vuetify: {
129121
treeShake: true,

web/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
},
2323
"dependencies": {
2424
"@mdi/js": "^7.2.96",
25-
"@nuxtjs/axios": "^5.13.6",
2625
"@nuxtjs/dotenv": "^1.4.1",
2726
"@nuxtjs/firebase": "^8.2.2",
2827
"@nuxtjs/sitemap": "^2.4.0",

web/plugins/errors.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
// @ts-ignore
21
import { AxiosError } from 'axios'
32
import Bag from '@/plugins/bag'
43
import capitalize from '@/plugins/capitalize'
54

6-
export type ErrorMessagesSerialized = {
7-
[name: string]: Array<string>
8-
}
9-
105
export class ErrorMessages extends Bag<string> {}
116

127
const sanitize = (key: string, values: Array<string>): Array<string> => {
@@ -31,15 +26,15 @@ export const getErrorMessages = (error: AxiosError): ErrorMessages => {
3126
const errors = new ErrorMessages()
3227
if (
3328
error === null ||
34-
typeof error.response?.data?.data !== 'object' ||
35-
error.response?.data?.data === null ||
29+
typeof (error.response?.data as any)?.data !== 'object' ||
30+
(error.response?.data as any)?.data === null ||
3631
error.response?.status !== 422
3732
) {
3833
return errors
3934
}
4035

41-
Object.keys(error.response.data.data).forEach((key: string) => {
42-
errors.addMany(key, sanitize(key, error.response?.data.data[key]))
36+
Object.keys((error.response?.data as any).data).forEach((key: string) => {
37+
errors.addMany(key, sanitize(key, (error.response?.data as any).data[key]))
4338
})
4439

4540
return errors

web/pnpm-lock.yaml

Lines changed: 1 addition & 112 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)