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

Добро пожаловать, или посторонним вход воспрещён (часть 2) #11

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

Shepard-m
Copy link
Contributor

@Shepard-m Shepard-m commented Mar 24, 2024

@keksobot keksobot changed the title переписал проект на slice, исправил ошибки Добро пожаловать, или посторонним вход воспрещён (часть 2) Mar 24, 2024
@keksobot keksobot merged commit b2d6b0f into htmlacademy-react:master Mar 27, 2024
0 of 2 checks passed
return <Navigate state={{ from: location }} to={AppRoute.Login} />;
}

// return (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Удалить комментарий

import { UserData } from '../types/user-data';
import { AuthData } from '../types/auth-data';
import { saveToken } from '../service/token';
import { TUser } from '../types/user';

export const fetchOffersAction = createAsyncThunk<void, undefined, {
export const fetchOffersAction = createAsyncThunk<OfferPreviews[], undefined, {
dispatch: AppDispatch;
Copy link
Collaborator

@MaxOrel MaxOrel Mar 30, 2024

Choose a reason for hiding this comment

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

Вынести типизацию Thunk Api в отдельный тип и подключать его здесь

import { OfferPreviews } from '../../types/offer-preview';

type TInitialState = {
status: string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Типизация должна быть RequestStatus


type TInitialState = {
status: string;
isOfferDataLoadingStatus: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Если используешь RequestStatus это поле и подобные ему не нужны


type TInitialState = {
status: string;
isOfferDataLoadingStatus: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Это срез пользователя при чем тут Offer, вообще лучше убрать это поле и менять status

Copy link
Collaborator

@MaxOrel MaxOrel left a comment

Choose a reason for hiding this comment

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

Принято

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.

3 participants