mirror of
https://github.com/dotFionn/iassure-wx.git
synced 2026-04-01 19:02:56 -05:00
19 lines
481 B
TypeScript
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,
|
|
};
|