-
Notifications
You must be signed in to change notification settings - Fork 29
fix: 인터뷰 페이지에서 공통된 API 콜 하도록 수정 #1643
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
Conversation
- Replaced local Axios instances in InterviewSetup and InterviewSession with the shared 'client' from src/apis. - This improves maintainability and consistency in API requests.
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.
Hello @jaeyeonling, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request focuses on refactoring the API call structure within the InterviewPage
component. Instead of creating new Axios instances in each file, it centralizes API calls through a shared client
module. Additionally, there are minor improvements to conditional logic and error handling in InterviewSetup
. Specifically, the local Axios instances in InterviewSetup.tsx
and InterviewSession.tsx
have been replaced with the shared 'client' from src/apis
.
Highlights
- API Refactoring: The pull request replaces locally defined Axios instances in
InterviewSession
andInterviewSetup
with a sharedclient
module fromsrc/apis
. - Logic and Error Handling: The pull request simplifies conditional statements for
selectedSession
andselectedMission
inInterviewSetup
and adds validation and error messaging tohandleStartInterview
.
Changelog
- frontend/src/pages/InterviewPage/InterviewSession.tsx
- Replaced local Axios instance with
client
from../../apis
(lines 3, 199, 223, 243). - Updated API calls for
/answers
,/restart
, and/quit
endpoints to useclient.post
(lines 199, 223, 243).
- Replaced local Axios instance with
- frontend/src/pages/InterviewPage/InterviewSetup.tsx
- Replaced local Axios instance with
client
from../../apis
(line 3). - Simplified conditional logic for fetching missions and questions (lines 213, 232).
- Updated API calls for
/sessions/mine
,/missions
,/questions
, and/interviews
to useclient.get
andclient.post
(lines 197, 216, 235, 265). - Added validation for
selectedSession
,selectedMission
, andselectedQuestion
inhandleStartInterview
(line 260). - Added error alert when interview start fails (line 279).
- Replaced local Axios instance with
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
A common client,
For API's ascent,
Code made more clean,
A joy to be seen,
Bugs now transient.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request refactors the API calling logic in the InterviewPage
component to use a centralized client
module instead of creating new Axios instances in each file. It also includes minor improvements to conditional logic and error handling in InterviewSetup
. Overall, the changes improve maintainability and consistency.
Summary of Findings
- Redundant conditional logic: The original code in
InterviewSetup.tsx
had redundant conditional logic for handlingselectedSession
andselectedMission
. The refactored code simplifies these conditions, improving readability and reducing potential errors. - Centralized API client: The pull request replaces local Axios instances with a shared
client
module fromsrc/apis
. This change promotes consistency and simplifies API request management across the application. - Improved error handling: The
handleStartInterview
function inInterviewSetup.tsx
now includes additional validation forselectedSession
,selectedMission
, andselectedQuestion
, and displays an alert message if the interview fails to start. This enhances the user experience by providing more informative feedback.
Merge Readiness
The pull request is well-structured and addresses the issue of inconsistent API calls effectively. The improvements to error handling and conditional logic enhance the robustness and maintainability of the code. I recommend merging this pull request after addressing the comments provided. I am unable to directly approve the pull request, and recommend that others review and approve this code before merging.
이 풀 리퀘스트는
InterviewPage
컴포넌트에서 API 호출 방식을 리팩터링하여 각 파일마다 새로운 Axios 인스턴스를 생성하는 대신 중앙 집중화된client
모듈을 사용하도록 변경했습니다. 또한,InterviewSetup
에서 조건문 로직과 에러 처리에 대한 소폭 개선도 포함되어 있습니다.API 리팩터링:
InterviewSession
및InterviewSetup
컴포넌트(frontend/src/pages/InterviewPage/InterviewSession.tsx
,frontend/src/pages/InterviewPage/InterviewSetup.tsx
)에서 로컬로 정의된 Axios 인스턴스(api
)를 공유client
모듈로 교체했습니다. [[1]] [[2]]InterviewSession
에서/answers
,/restart
,/quit
등의 엔드포인트에 대한 모든 API 호출을client.post
로 변경했습니다. [[1]] [[2]] [[3]]InterviewSetup
에서/sessions/mine
,/missions
,/questions
,/interviews
등의 엔드포인트에 대해client.get
및client.post
를 사용하도록 API 호출을 업데이트했습니다. [[1]] [[2]] [[3]] [[4]]로직 및 에러 처리 개선:
InterviewSetup
내selectedSession
및selectedMission
에 대한 조건문을 단순화하여 중복 코드를 줄였습니다. [[1]] [[2]]InterviewSetup
의handleStartInterview
함수에서selectedSession
및selectedMission
에 대한 추가 유효성 검사를 포함시키고, 인터뷰 시작 실패 시 알림 메시지를 추가했습니다.src/apis
의 공유 'client'로 교체했습니다.