build error fixes
This commit is contained in:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user