mirror of
https://github.com/dotFionn/iassure-wx.git
synced 2026-03-21 06:22:56 -05:00
move types to shared, add first stuff
This commit is contained in:
18
frontend/src/services/wx.service.ts
Normal file
18
frontend/src/services/wx.service.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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,
|
||||
};
|
||||
Reference in New Issue
Block a user