move types to shared, add first stuff

This commit is contained in:
2023-05-04 20:40:10 +02:00
parent 1ed359f602
commit df097ab4f6
23 changed files with 1118 additions and 214 deletions

View 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,
};