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

Refactor: some fetcher-related code #121

Merged

Conversation

WhiteMinds
Copy link

This PR extracts the types related to fetcher from the components to ExplorerService and index.d.ts, preparing for the next step of refactoring to the models level.

@vercel
Copy link

vercel bot commented Oct 17, 2023

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

Name Status Preview Comments Updated (UTC)
ckb-explorer-frontend-in-magickbase-repo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2023 5:11am

@WhiteMinds
Copy link
Author

Rebased.

src/components/Search/index.tsx Outdated Show resolved Hide resolved

if (
isAxiosError(error) &&
error.response?.data &&
Copy link

Choose a reason for hiding this comment

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

Suggested change
error.response?.data &&
error.response &&
error.response.data &&

Copy link
Author

Choose a reason for hiding this comment

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

The type of response here is still Nullable, probably because AxiosError might be thrown before and during the request?

export interface AxiosError<T = any> extends Error {
  ...,
  response?: AxiosResponse<T>;
  ...,
}

@WhiteMinds
Copy link
Author

Rebased.

@WhiteMinds
Copy link
Author

Rebased.

@WhiteMinds WhiteMinds force-pushed the refactor/434_RelatedToFetcher branch from 119d0ea to b4056f9 Compare October 25, 2023 05:10
@WhiteMinds WhiteMinds requested a review from Daryl-L October 25, 2023 05:10
@WhiteMinds WhiteMinds added this pull request to the merge queue Oct 25, 2023
Merged via the queue into Magickbase:develop with commit 0d82655 Oct 25, 2023
1 check passed
@WhiteMinds WhiteMinds deleted the refactor/434_RelatedToFetcher branch October 25, 2023 05:12
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