Files
iassure-wx/frontend/src/services/wx.service.ts

19 lines
481 B
TypeScript

import { WxRegion } from '@shared/types/config.types';
import { WxData } from '@shared/types/wx.types';
import axios from 'axios';
async function getRegions(): Promise<WxRegion[]> {
const response = await axios.get<WxRegion[]>('/api/regions');
return response.data;
}
async function getWxData(region: string): Promise<WxData> {
const response = await axios.get<WxData>(`/api/regions/${region}/wx`);
return response.data;
}
export default {
getRegions,
getWxData,
};