diff --git a/package-lock.json b/package-lock.json
index 1eae1900..bf9cd422 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -11,12 +11,10 @@
"dependencies": {
"@heroicons/react": "^2.0.17",
"@tanstack/react-query": "^5.17.8",
- "@types/offscreencanvas": "^2019.7.1",
"axios": "^1.6.5",
"date-fns": "^3.3.1",
"leaflet": "^1.9.4",
"leaflet.locatecontrol": "^0.79.0",
- "prop-types": "^15.8.1",
"radash": "^12.1.0",
"react-colorful": "^5.6.1",
"react-image-crop": "^10.1.8",
@@ -25,7 +23,6 @@
"react-markdown": "^9.0.1",
"react-photo-album": "^3.0.2",
"react-router-dom": "^6.16.0",
- "react-string-replace": "^1.1.1",
"react-toastify": "^9.1.3",
"remark-breaks": "^4.0.0",
"tw-elements": "^1.0.0",
@@ -56,6 +53,7 @@
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-json": "^3.1.0",
+ "eslint-plugin-n": "^16.6.2",
"eslint-plugin-no-catch-all": "^1.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^6.1.1",
@@ -64,7 +62,6 @@
"eslint-plugin-react-refresh": "^0.4.18",
"eslint-plugin-security": "^3.0.1",
"eslint-plugin-yml": "^1.14.0",
- "globals": "^15.14.0",
"happy-dom": "^16.8.1",
"postcss": "^8.4.21",
"prettier": "^3.3.3",
@@ -1005,35 +1002,6 @@
"url": "https://opencollective.com/eslint"
}
},
- "node_modules/@eslint/eslintrc/node_modules/globals": {
- "version": "13.24.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
- "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "type-fest": "^0.20.2"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/@eslint/eslintrc/node_modules/type-fest": {
- "version": "0.20.2",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
- "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
- "dev": true,
- "license": "(MIT OR CC0-1.0)",
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/@eslint/js": {
"version": "8.57.1",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz",
@@ -2030,12 +1998,6 @@
"undici-types": "~6.20.0"
}
},
- "node_modules/@types/offscreencanvas": {
- "version": "2019.7.3",
- "resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.7.3.tgz",
- "integrity": "sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A==",
- "license": "MIT"
- },
"node_modules/@types/prop-types": {
"version": "15.7.14",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.14.tgz",
@@ -3163,7 +3125,6 @@
"integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==",
"dev": true,
"license": "MIT",
- "peer": true,
"engines": {
"node": ">=6"
},
@@ -3177,7 +3138,6 @@
"integrity": "sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"semver": "^7.0.0"
}
@@ -4696,7 +4656,6 @@
"integrity": "sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"semver": "^7.5.4"
},
@@ -4845,7 +4804,6 @@
"https://opencollective.com/eslint"
],
"license": "MIT",
- "peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.1.2",
"@eslint-community/regexpp": "^4.11.0",
@@ -4945,7 +4903,6 @@
"integrity": "sha512-6TyDmZ1HXoFQXnhCTUjVFULReoBPOAjpuiKELMkeP40yffI/1ZRO+d9ug/VC6fqISo2WkuIBk3cvuRPALaWlOQ==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"builtins": "^5.0.1",
@@ -4969,37 +4926,6 @@
"eslint": ">=7.0.0"
}
},
- "node_modules/eslint-plugin-n/node_modules/globals": {
- "version": "13.24.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
- "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
- "dev": true,
- "license": "MIT",
- "peer": true,
- "dependencies": {
- "type-fest": "^0.20.2"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/eslint-plugin-n/node_modules/type-fest": {
- "version": "0.20.2",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
- "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
- "dev": true,
- "license": "(MIT OR CC0-1.0)",
- "peer": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/eslint-plugin-no-catch-all": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-no-catch-all/-/eslint-plugin-no-catch-all-1.1.0.tgz",
@@ -5263,35 +5189,6 @@
"url": "https://opencollective.com/eslint"
}
},
- "node_modules/eslint/node_modules/globals": {
- "version": "13.24.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
- "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "type-fest": "^0.20.2"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/eslint/node_modules/type-fest": {
- "version": "0.20.2",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
- "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
- "dev": true,
- "license": "(MIT OR CC0-1.0)",
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/espree": {
"version": "9.6.1",
"resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
@@ -6013,13 +5910,29 @@
}
},
"node_modules/globals": {
- "version": "15.15.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz",
- "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==",
+ "version": "13.24.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
+ "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
"dev": true,
"license": "MIT",
+ "dependencies": {
+ "type-fest": "^0.20.2"
+ },
"engines": {
- "node": ">=18"
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/globals/node_modules/type-fest": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
+ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
+ "dev": true,
+ "license": "(MIT OR CC0-1.0)",
+ "engines": {
+ "node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
@@ -6563,7 +6476,6 @@
"integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"builtin-modules": "^3.3.0"
},
@@ -9788,6 +9700,7 @@
"version": "15.8.1",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
"integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"loose-envify": "^1.4.0",
@@ -9799,6 +9712,7 @@
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
+ "dev": true,
"license": "MIT"
},
"node_modules/property-information": {
@@ -10072,15 +9986,6 @@
"react-dom": ">=16.8"
}
},
- "node_modules/react-string-replace": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/react-string-replace/-/react-string-replace-1.1.1.tgz",
- "integrity": "sha512-26TUbLzLfHQ5jO5N7y3Mx88eeKo0Ml0UjCQuX4BMfOd/JX+enQqlKpL1CZnmjeBRvQE8TR+ds9j1rqx9CxhKHQ==",
- "license": "MIT",
- "engines": {
- "node": ">=0.12.0"
- }
- },
"node_modules/react-toastify": {
"version": "9.1.3",
"resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-9.1.3.tgz",
diff --git a/package.json b/package.json
index e73f5764..60b30c32 100644
--- a/package.json
+++ b/package.json
@@ -58,6 +58,7 @@
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-json": "^3.1.0",
+ "eslint-plugin-n": "^16.6.2",
"eslint-plugin-no-catch-all": "^1.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^6.1.1",
@@ -66,7 +67,6 @@
"eslint-plugin-react-refresh": "^0.4.18",
"eslint-plugin-security": "^3.0.1",
"eslint-plugin-yml": "^1.14.0",
- "globals": "^15.14.0",
"happy-dom": "^16.8.1",
"postcss": "^8.4.21",
"prettier": "^3.3.3",
@@ -90,12 +90,10 @@
"dependencies": {
"@heroicons/react": "^2.0.17",
"@tanstack/react-query": "^5.17.8",
- "@types/offscreencanvas": "^2019.7.1",
"axios": "^1.6.5",
"date-fns": "^3.3.1",
"leaflet": "^1.9.4",
"leaflet.locatecontrol": "^0.79.0",
- "prop-types": "^15.8.1",
"radash": "^12.1.0",
"react-colorful": "^5.6.1",
"react-image-crop": "^10.1.8",
@@ -104,7 +102,6 @@
"react-markdown": "^9.0.1",
"react-photo-album": "^3.0.2",
"react-router-dom": "^6.16.0",
- "react-string-replace": "^1.1.1",
"react-toastify": "^9.1.3",
"remark-breaks": "^4.0.0",
"tw-elements": "^1.0.0",
diff --git a/src/Components/Auth/LoginPage.tsx b/src/Components/Auth/LoginPage.tsx
index 14177275..d146bb73 100644
--- a/src/Components/Auth/LoginPage.tsx
+++ b/src/Components/Auth/LoginPage.tsx
@@ -1,8 +1,3 @@
-/* eslint-disable @typescript-eslint/no-misused-promises */
-/* eslint-disable @typescript-eslint/restrict-template-expressions */
-/* eslint-disable @typescript-eslint/no-unsafe-member-access */
-/* eslint-disable @typescript-eslint/no-unsafe-call */
-/* eslint-disable @typescript-eslint/no-floating-promises */
import { useEffect, useState } from 'react'
import { Link, useNavigate } from 'react-router-dom'
import { toast } from 'react-toastify'
@@ -28,14 +23,14 @@ export function LoginPage() {
success: {
render({ data }) {
navigate('/')
- return `Hi ${data?.first_name}`
+ return `Hi ${data?.first_name ? data.first_name : 'Traveler'}`
},
// other options
icon: '✌️',
},
error: {
render({ data }) {
- return `${data}`
+ return `${data as string}`
},
autoClose: 10000,
},
@@ -44,9 +39,10 @@ export function LoginPage() {
}
useEffect(() => {
- const keyDownHandler = (event) => {
+ const keyDownHandler = (event: KeyboardEvent) => {
if (event.key === 'Enter') {
event.preventDefault()
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
onLogin()
}
}
@@ -86,6 +82,7 @@ export function LoginPage() {
? 'tw-btn tw-btn-disabled tw-btn-block tw-btn-primary'
: 'tw-btn tw-btn-primary tw-btn-block'
}
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
onClick={() => onLogin()}
>
{loading ? : 'Login'}
diff --git a/src/Components/Auth/RequestPasswordPage.tsx b/src/Components/Auth/RequestPasswordPage.tsx
index b26c70c2..4ebbce2c 100644
--- a/src/Components/Auth/RequestPasswordPage.tsx
+++ b/src/Components/Auth/RequestPasswordPage.tsx
@@ -1,6 +1,3 @@
-/* eslint-disable @typescript-eslint/restrict-template-expressions */
-/* eslint-disable @typescript-eslint/no-misused-promises */
-/* eslint-disable @typescript-eslint/no-unsafe-argument */
import { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { toast } from 'react-toastify'
@@ -12,8 +9,7 @@ import { useAuth } from './useAuth'
/**
* @category Auth
*/
-// eslint-disable-next-line react/prop-types
-export function RequestPasswordPage({ resetUrl }) {
+export function RequestPasswordPage({ resetUrl }: { resetUrl: string }) {
const [email, setEmail] = useState('')
const { requestPasswordReset, loading } = useAuth()
@@ -32,7 +28,7 @@ export function RequestPasswordPage({ resetUrl }) {
},
error: {
render({ data }) {
- return `${data}`
+ return `${data as string}`
},
},
pending: 'sending email ...',
@@ -56,6 +52,7 @@ export function RequestPasswordPage({ resetUrl }) {
? 'tw-btn tw-btn-disabled tw-btn-block tw-btn-primary'
: 'tw-btn tw-btn-primary tw-btn-block'
}
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
onClick={() => onReset()}
>
{loading ? : 'Send'}
diff --git a/src/Components/Auth/SetNewPasswordPage.tsx b/src/Components/Auth/SetNewPasswordPage.tsx
index 9bf33054..e38b10b9 100644
--- a/src/Components/Auth/SetNewPasswordPage.tsx
+++ b/src/Components/Auth/SetNewPasswordPage.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable @typescript-eslint/no-misused-promises */
-/* eslint-disable @typescript-eslint/restrict-template-expressions */
import { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { toast } from 'react-toastify'
@@ -20,8 +18,6 @@ export function SetNewPasswordPage() {
const onReset = async () => {
const token = window.location.search.split('token=')[1]
- // eslint-disable-next-line no-console
- console.log(token)
await toast.promise(passwordReset(token, password), {
success: {
@@ -32,7 +28,7 @@ export function SetNewPasswordPage() {
},
error: {
render({ data }) {
- return `${data}`
+ return `${data as string}`
},
},
pending: 'setting password ...',
@@ -55,6 +51,7 @@ export function SetNewPasswordPage() {
? 'tw-btn tw-btn-disabled tw-btn-block tw-btn-primary'
: 'tw-btn tw-btn-primary tw-btn-block'
}
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
onClick={() => onReset()}
>
{loading ? : 'Set'}
diff --git a/src/Components/Auth/SignupPage.tsx b/src/Components/Auth/SignupPage.tsx
index 57c559c4..2e15481c 100644
--- a/src/Components/Auth/SignupPage.tsx
+++ b/src/Components/Auth/SignupPage.tsx
@@ -1,8 +1,3 @@
-/* eslint-disable @typescript-eslint/restrict-template-expressions */
-/* eslint-disable @typescript-eslint/no-floating-promises */
-/* eslint-disable @typescript-eslint/no-unsafe-call */
-/* eslint-disable @typescript-eslint/no-unsafe-member-access */
-/* eslint-disable @typescript-eslint/no-misused-promises */
import { useEffect, useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { toast } from 'react-toastify'
@@ -30,14 +25,14 @@ export function SignupPage() {
success: {
render({ data }) {
navigate('/')
- return `Hi ${data?.first_name}`
+ return `Hi ${data?.first_name ? data.first_name : 'Traveler'}`
},
// other options
icon: '✌️',
},
error: {
render({ data }) {
- return `${data}`
+ return `${data as string}`
},
autoClose: 10000,
},
@@ -46,9 +41,10 @@ export function SignupPage() {
}
useEffect(() => {
- const keyDownHandler = (event) => {
+ const keyDownHandler = (event: KeyboardEvent) => {
if (event.key === 'Enter') {
event.preventDefault()
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
onRegister()
}
}
@@ -88,6 +84,7 @@ export function SignupPage() {
? 'tw-btn tw-btn-disabled tw-btn-block tw-btn-primary'
: 'tw-btn tw-btn-primary tw-btn-block'
}
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
onClick={() => onRegister()}
>
{loading ? : 'Sign Up'}
diff --git a/src/Components/Auth/useAuth.tsx b/src/Components/Auth/useAuth.tsx
index ffde8af5..60a8679f 100644
--- a/src/Components/Auth/useAuth.tsx
+++ b/src/Components/Auth/useAuth.tsx
@@ -1,8 +1,3 @@
-/* eslint-disable @typescript-eslint/no-unused-vars */
-/* eslint-disable @typescript-eslint/no-unsafe-return */
-/* eslint-disable @typescript-eslint/no-unsafe-argument */
-/* eslint-disable @typescript-eslint/no-floating-promises */
-/* eslint-disable @typescript-eslint/no-explicit-any */
import { createContext, useState, useContext, useEffect } from 'react'
import type { UserApi } from '#types/UserApi'
@@ -28,11 +23,11 @@ interface AuthContextProps {
login: (credentials: AuthCredentials) => Promise
register: (credentials: AuthCredentials, userName: string) => Promise
loading: boolean
- logout: () => Promise
- updateUser: (user: UserItem) => any
- token: string | null
- requestPasswordReset: (email: string, reset_url: string) => Promise
- passwordReset: (token: string, new_password: string) => Promise
+ logout: () => Promise
+ updateUser: (user: UserItem) => Promise
+ token: string | undefined
+ requestPasswordReset: (email: string, reset_url: string) => Promise
+ passwordReset: (token: string, new_password: string) => Promise
}
const AuthContext = createContext({
@@ -53,12 +48,13 @@ const AuthContext = createContext({
*/
export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
const [user, setUser] = useState(null)
- const [token, setToken] = useState(null)
+ const [token, setToken] = useState()
const [loading, setLoading] = useState(false)
const isAuthenticated = !!user
useEffect(() => {
setLoading(true)
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
loadUser()
setLoading(false)
// eslint-disable-next-line react-hooks/exhaustive-deps
@@ -84,10 +80,10 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
const login = async (credentials: AuthCredentials): Promise => {
setLoading(true)
try {
- const res = await userApi.login(credentials.email, credentials.password)
- setToken(res?.access_token)
+ const user = await userApi.login(credentials.email, credentials.password)
+ setToken(user?.access_token)
return await loadUser()
- } catch (error: any) {
+ } catch (error) {
setLoading(false)
throw error
}
@@ -95,13 +91,13 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
const register = async (
credentials: AuthCredentials,
- userName,
+ userName: string,
): Promise => {
setLoading(true)
try {
/* const res = */ await userApi.register(credentials.email, credentials.password, userName)
return await login(credentials)
- } catch (error: any) {
+ } catch (error) {
setLoading(false)
throw error
}
@@ -111,7 +107,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
try {
await userApi.logout()
setUser(null)
- } catch (error: any) {
+ } catch (error) {
setLoading(false)
throw error
}
@@ -119,37 +115,35 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
const updateUser = async (user: UserItem) => {
setLoading(true)
- const { id, ...userRest } = user
-
try {
- const res = await userApi.updateUser(userRest)
- setUser(res as any)
- loadUser()
+ const updatedUser = await userApi.updateUser(user)
+ setUser(updatedUser)
+ await loadUser()
setLoading(false)
- return res as any
- } catch (error: any) {
+ return updatedUser
+ } catch (error) {
setLoading(false)
throw error
}
}
- const requestPasswordReset = async (email: string, resetUrl?: string): Promise => {
+ const requestPasswordReset = async (email: string, resetUrl?: string): Promise => {
setLoading(true)
try {
await userApi.requestPasswordReset(email, resetUrl)
return setLoading(false)
- } catch (error: any) {
+ } catch (error) {
setLoading(false)
throw error
}
}
- const passwordReset = async (token: string, newPassword: string): Promise => {
+ const passwordReset = async (token: string, newPassword: string): Promise => {
setLoading(true)
try {
await userApi.passwordReset(token, newPassword)
return setLoading(false)
- } catch (error: any) {
+ } catch (error) {
setLoading(false)
throw error
}
diff --git a/src/Components/Profile/UserSettings.tsx b/src/Components/Profile/UserSettings.tsx
index 0b2da6cb..0e974cd6 100644
--- a/src/Components/Profile/UserSettings.tsx
+++ b/src/Components/Profile/UserSettings.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import { useEffect, useState } from 'react'
import { useNavigate } from 'react-router-dom'
diff --git a/src/types/UserApi.d.ts b/src/types/UserApi.d.ts
index a35e079d..98fb64db 100644
--- a/src/types/UserApi.d.ts
+++ b/src/types/UserApi.d.ts
@@ -8,8 +8,8 @@ export interface UserApi {
login(email: string, password: string): Promise
logout(): Promise
getUser(): Promise
- getToken(): Promise
- updateUser(user: UserItem): Promise
+ getToken(): Promise
+ updateUser(user: UserItem): Promise
requestPasswordReset(email: string, reset_url?: string)
passwordReset(token: string, new_password: string)
}
diff --git a/src/types/UserItem.d.ts b/src/types/UserItem.d.ts
index 68ccb8d7..00942294 100644
--- a/src/types/UserItem.d.ts
+++ b/src/types/UserItem.d.ts
@@ -11,6 +11,7 @@ export interface UserItem {
password?: string
profile?: Profile
first_name?: string
+ access_token?: string
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any
}