build error fixes

This commit is contained in:
2025-10-09 23:12:48 +05:30
parent 86b4a01bf3
commit 83346d0031
3 changed files with 31 additions and 21 deletions

View File

@ -52,7 +52,8 @@ export interface FacultyApiResponse {
// API service class
export class FacultyService {
private static baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:8080';
private static baseUrl =
process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8080';
static async getAllFaculty(): Promise<TeamMember[]> {
try {
@ -63,9 +64,7 @@ export class FacultyService {
},
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
const data: FacultyApiResponse = await response.json();
return this.transformProfessorsToTeamMembers(data.content);
@ -77,8 +76,6 @@ export class FacultyService {
static async getFacultyById(id: number): Promise<TeamMember | null> {
try {
// Find by array index from getAllFaculty for now
// In production, you might want a direct API call
const allFaculty = await this.getAllFaculty();
return allFaculty.find(member => member.id === id) || null;
} catch (error) {