You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
481 B
19 lines
481 B
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,
|
|
};
|