-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(23-UG20): реализовать API смены пароля #47
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
useEffect(() => { | ||
if (isSuccess.password) { | ||
setTimeout(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вот здесь я бы предусмотрел отмену этого таймера на случай, если за 3 секунды пользователь перейдет на какую-то другую страницу.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавил отмену таймера и очистку формы
@@ -53,6 +59,10 @@ export const userThunks = { | |||
const newUser = await userAPI.changeUserProfile(data); | |||
dispatch(authSlice.actions.setUser(newUser)); | |||
}), | |||
changeUserPassword: createAsyncThunk( | |||
"USER/password", | |||
async (data: PasswordChangeRequest) => await userAPI.changeUserPassword(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не делайте return await - эта конструкция не имеет никакого смысла. Можно смело убрать тут async/await и ничего не изменится
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Внес правки
Какую задачу решаем
Реализация API смены пароля