diff --git a/packages/client/src/app/App.test.tsx b/packages/client/src/app/App.test.tsx index ccc7648..b8a177d 100644 --- a/packages/client/src/app/App.test.tsx +++ b/packages/client/src/app/App.test.tsx @@ -3,6 +3,7 @@ // const appContent = 'Вот тут будет жить ваше приложение :)' +// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore @typescript-eslint/ban-ts-comment global.fetch = jest.fn(() => Promise.resolve({ json: () => Promise.resolve('hey') }) diff --git a/packages/client/src/components/ui/Button/Button.tsx b/packages/client/src/components/ui/Button/Button.tsx index 2f7a774..e0e7c4d 100644 --- a/packages/client/src/components/ui/Button/Button.tsx +++ b/packages/client/src/components/ui/Button/Button.tsx @@ -6,6 +6,7 @@ export const Button = (props: { className?: string | undefined useFixWidth?: boolean | undefined href?: string | undefined + /* eslint-disable @typescript-eslint/no-explicit-any */ onClick?: (() => Promise) | (() => any) | undefined }) => { const { text, className, useFixWidth = false, href = '/', onClick } = props diff --git a/packages/client/src/store/reducers/user-reducer.ts b/packages/client/src/store/reducers/user-reducer.ts index a6783b1..97c1219 100644 --- a/packages/client/src/store/reducers/user-reducer.ts +++ b/packages/client/src/store/reducers/user-reducer.ts @@ -35,12 +35,14 @@ export const getUser = () => async (dispatch: AppDispatch) => { method: 'get', url: `${import.meta.env.VITE_AUTH_URL}/auth/user`, }) - .then((data: any) => { + .then((data: { data: UserType }) => { if (data) { dispatch(actions.setUser(data.data)) } }) - .catch(() => {}) + .catch((error) => { + console.error(error) + }) } export const logoutUser = () => async (dispatch: AppDispatch) => { @@ -48,14 +50,13 @@ export const logoutUser = () => async (dispatch: AppDispatch) => { method: 'post', url: `${import.meta.env.VITE_AUTH_URL}/auth/logout`, }) - .then((data: any) => { - if (data) { - dispatch(actions.setUser(null)) - - window.location.href = '/' - } + .then(() => { + dispatch(actions.setUser(null)) + window.location.href = '/' + }) + .catch((error) => { + console.error(error) }) - .catch(() => {}) } export const signInUser = @@ -78,7 +79,9 @@ export const signInUser = } } }) - .catch(() => {}) + .catch((error) => { + console.error(error) + }) } export const signUpUser = @@ -88,13 +91,15 @@ export const signUpUser = url: `${import.meta.env.VITE_AUTH_URL}/auth/signup`, data: form, }) - .then(data => { + .then((data: { data: UserType }) => { if (data) { - dispatch(actions.setUser(data)) + dispatch(actions.setUser(data.data)) dispatch(getUser()) } }) - .catch(() => {}) + .catch((error) => { + console.error(error) + }) } export type ActionsType = InferAppActions