connected backend to service page and detail
This commit is contained in:
27
lib/api/demoapi/operationalSystems.ts
Normal file
27
lib/api/demoapi/operationalSystems.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
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;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user