대민 현황 데이터 api 수정 적용
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { DmStatusChartType, DmStatusDataType, RegionData, } from "../store/wrStatus/type";
|
||||
import type { RegionData, } from "../store/wrStatus/type";
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ export const regionIdMap: Record<string, string> = {
|
||||
};
|
||||
|
||||
|
||||
const makeRegion = (region: string) => {
|
||||
export const makeRegion = (region: string) => {
|
||||
if (region === '서울특별시') return '서울'
|
||||
if (region === '부산광역시') return '부산'
|
||||
if (region === '대구광역시') return '대구'
|
||||
@@ -56,19 +56,10 @@ const makeRegion = (region: string) => {
|
||||
if (region === '강원특별자치도') return '강원'
|
||||
if (region === '충청북도') return '충북'
|
||||
if (region === '충청남도') return '충남'
|
||||
if (region === '전라북도') return '전북'
|
||||
if (region === '전북특별자치도') return '전북'
|
||||
if (region === '전라남도') return '전남'
|
||||
if (region === '경상북도') return '경북'
|
||||
if (region === '경상남도') return '경남'
|
||||
if (region === '제주특별자치도') return '제주'
|
||||
return region;
|
||||
}
|
||||
export const changeStatusMapData= (data: DmStatusDataType[]) : DmStatusChartType[]=> {
|
||||
return data.map((item) => ({
|
||||
label: makeRegion(item.region??''),
|
||||
하수: item.sewage.split('(')[0]?.replaceAll(',','') ??'',
|
||||
빗물: item.rainwater.split('(')[0]?.replaceAll(',','')??'',
|
||||
중수도: item.reclaimed.split('(')[0]?.replaceAll(',','') ??'',
|
||||
온배수: item.thermal.split('(')[0]?.replaceAll(',','') ??'',
|
||||
}));
|
||||
}
|
||||
Reference in New Issue
Block a user