Feature: Search Issues using GitHub search API#523
Conversation
|
@bharati-21 is attempting to deploy a commit to the RDS-Team Team on Vercel. A member of the Team first needs to authorize it. |
vvaibhavdesai
left a comment
There was a problem hiding this comment.
there are few component please address those
| const [issueList, setIssueList] = useState<[]>([]); | ||
| const [searchText, setSearchText] = useState(''); | ||
| const [isLoading, setIsLoading] = useState(true); | ||
| const [error, setError] = useState<null | any>(null); |
There was a problem hiding this comment.
Can you please elaborate?
There was a problem hiding this comment.
why is the error state set to any ?
There was a problem hiding this comment.
When an error is caught, the error state is set to the error object - the type of which is unknown. Hence, have set to any | null.
There was a problem hiding this comment.
But I think the error object must have a defined structure else it would be kind of difficult to do error handling on frontend
There was a problem hiding this comment.
It is difficult to do so because the error here is from the GitHub API - which is not feasible to define.
There was a problem hiding this comment.
have we checked this? I am sure GitHub might have something for a use case as well Link
There was a problem hiding this comment.
@vvaibhavdesai Yes, even in the API there are sample responses for error cases.
But while fetching issues from the backend, along with GitHub API, there are few calls made to the firestore data models as well. Predicting errors in this case is not exhaustive and missing out any of the error scenarios could lead to issues in the frontend.
There was a problem hiding this comment.
@bharati-21 Please mention the ticket for the future changes here.
There was a problem hiding this comment.
Feature: Search Issues using GitHub search API
This PR addresses the following issue to search for issues across RDS repositories
GET /issuesAPI, which in turn calls the appropriate GitHub API.