-
Notifications
You must be signed in to change notification settings - Fork 0
fix(MAJORLEA-005): 5 review findings across 2 files #78
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,6 @@ import { HiringManagerProfile, JobOpening } from '../types/hiring'; | |
|
|
||
| // Configure axios to use the backend URL from environment | ||
| const BACKEND_API_URL = process.env.BACKEND_API_URL || '/'; | ||
| console.log('API Service: Using backend URL:', BACKEND_API_URL); | ||
|
|
||
| axios.defaults.baseURL = BACKEND_API_URL; | ||
|
|
||
|
|
@@ -60,7 +59,7 @@ export function downloadContributors({ | |
|
|
||
| // Create a hidden link and click it to trigger the download | ||
| const link = document.createElement('a'); | ||
| link.href = `${BACKEND_API_URL}/api/contributors/export?${params.toString()}`; | ||
| link.href = `/api/contributors/export?${params.toString()}`; | ||
| link.download = 'contributors.csv'; | ||
| document.body.appendChild(link); | ||
| link.click(); | ||
|
Comment on lines
59
to
65
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π downloadContributors URL construction double-slash bug when BACKEND_API_URL ends with '/' Changed π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
|
|
@@ -222,4 +221,4 @@ export const getJobOpenings = async (): Promise<JobOpening[]> => { | |
| throw new Error(response.data.message); | ||
| } | ||
| return response.data.data; | ||
| }; // Force rebuild Sun Aug 31 19:49:51 EDT 2025 | ||
| }; | ||
|
Comment on lines
221
to
+224
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΅ frontend/src/services/api.ts has a trailing comment '// Force rebuild Sun Aug 31 19:49:51 EDT 2025' that should not be committed Removed the trailing π€ Prompt for AI agentsfix confidence: π’ 99 high β react π/π to teach the reviewer |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,27 +2,43 @@ import { City, Region, State } from '../types/api'; | |
| import { EnhancedCity, EnhancedRegion, EnhancedState } from '../types/enhanced'; | ||
| import { getStateById, getTeamById } from './api'; | ||
|
|
||
| async function getStateByIdChecked(stateId: string): Promise<State> { | ||
| const response = await getStateById(stateId); | ||
| if (!response || (response as any).status !== 'success') { | ||
| throw new Error(`getStateById(${stateId}) returned non-success status`); | ||
| } | ||
| return response; | ||
| } | ||
|
|
||
| async function getTeamByIdChecked(teamId: string) { | ||
| const response = await getTeamById(teamId); | ||
| if (!response || (response as any).status !== 'success') { | ||
| throw new Error(`getTeamById(${teamId}) returned non-success status`); | ||
| } | ||
| return response; | ||
| } | ||
|
|
||
| export async function enhanceCity(city: City): Promise<EnhancedCity> { | ||
| const [state, team] = await Promise.all([ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΄ enhanced.ts calls getStateById/getTeamById without checking response.data.status === 'success' In π€ Prompt for AI agentsfix confidence: π‘ 62 medium β react π/π to teach the reviewer |
||
| getStateById(city.stateId), | ||
| city.nearestTeamId ? getTeamById(city.nearestTeamId) : null | ||
| getStateByIdChecked(city.stateId), | ||
| city.nearestTeamId ? getTeamByIdChecked(city.nearestTeamId) : null | ||
| ]); | ||
|
|
||
| return { | ||
| ...city, | ||
| state: state || null, | ||
| state: state, | ||
| nearestTeam: team | ||
| }; | ||
| } | ||
|
|
||
| export async function enhanceRegion(region: Region): Promise<EnhancedRegion> { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΄ enhanceRegion silently drops failed getStateById calls via filter(s => s !== null) In π€ Prompt for AI agentsfix confidence: π‘ 62 medium β react π/π to teach the reviewer |
||
| const states = await Promise.all( | ||
| region.stateIds.map(stateId => getStateById(stateId)) | ||
| region.stateIds.map(stateId => getStateByIdChecked(stateId)) | ||
| ); | ||
|
|
||
| return { | ||
| ...region, | ||
| states: new Set(states.filter((s): s is State => s !== null)), | ||
| states: new Set(states), | ||
| cities: new Set() | ||
| }; | ||
| } | ||
|
|
@@ -34,4 +50,4 @@ export async function enhanceState(state: State): Promise<EnhancedState> { | |
| regions: new Set(), | ||
| cities: new Set() | ||
| }; | ||
| } | ||
| } | ||
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.
𦩠π Frontend api.ts uses console.log to print the backend URL β debug output left in production service layer
Removed the
console.log('API Service: Using backend URL:', BACKEND_API_URL);call at line 6. The line was deleted entirely; the surroundingconst BACKEND_API_URLdeclaration andaxios.defaults.baseURLassignment are preserved unchanged.π€ Prompt for AI agents
fix confidence: π’ 97 high β react π/π to teach the reviewer