Skip to content
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

Merged
merged 3 commits into from
Apr 11, 2023

Conversation

MakhovRoman
Copy link
Contributor

Какую задачу решаем

Реализация API смены пароля

@vercel
Copy link

vercel bot commented Apr 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
uno-game-client ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 10, 2023 7:58am

EAbashin

This comment was marked as duplicate.

@MakhovRoman MakhovRoman requested a review from Olegas April 10, 2023 03:40

useEffect(() => {
if (isSuccess.password) {
setTimeout(() => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вот здесь я бы предусмотрел отмену этого таймера на случай, если за 3 секунды пользователь перейдет на какую-то другую страницу.

Copy link
Contributor Author

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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не делайте return await - эта конструкция не имеет никакого смысла. Можно смело убрать тут async/await и ничего не изменится

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Внес правки

@MakhovRoman MakhovRoman merged commit f9ad2c4 into dev Apr 11, 2023
@cap-Bernardito cap-Bernardito deleted the dev-api-passwordChange branch April 25, 2023 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants