27 lines
659 B
TypeScript
27 lines
659 B
TypeScript
import axios from 'axios';
|
|
|
|
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'https://api.example.com';
|
|
|
|
export interface SystemFeature {
|
|
id: string;
|
|
title: string;
|
|
shortDesc?:string;
|
|
description: string;
|
|
features: string[];
|
|
image: string;
|
|
}
|
|
|
|
export const getOperationalSystems = async (): Promise<SystemFeature[]> => {
|
|
try {
|
|
const response = await axios.get(`${API_BASE_URL}/operational-systems`, {
|
|
timeout: 10000,
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
});
|
|
return response.data;
|
|
} catch (error) {
|
|
console.error('Error fetching operational systems:', error);
|
|
throw error;
|
|
}
|
|
}; |