시도시군구 정렬 삭제
This commit is contained in:
@@ -13,23 +13,20 @@ export type BIZ_CD_TYPE = {
|
||||
|
||||
export const fetchCtpvSggData = async (set: (state: any) => void) => {
|
||||
try {
|
||||
const ctpvData = await getCmsData('/api/v1/code/cache/ADSTDSTRCD');
|
||||
console.log("CTPV Data:", ctpvData);
|
||||
const ctpvData = await getCmsData('/api/v1/code/cache/ADSTDSTRCD/Y');
|
||||
const ctpvList: Option[] = ctpvData
|
||||
.filter((item: any) => typeof item.lwpoCd === 'string' && item.lwpoCd.length === 2)
|
||||
.map((feature: any) => ({
|
||||
id: feature.lwpoCd,
|
||||
name: feature.lwpoCdNm
|
||||
}))
|
||||
.sort((a: Option, b: Option) => a.name.localeCompare(b.name, 'ko'));
|
||||
}));
|
||||
|
||||
const sggList: Option[] = ctpvData
|
||||
.filter((item: any) => typeof item.lwpoCd === 'string' && item.lwpoCd.length !== 2)
|
||||
.map((item: any) => ({
|
||||
id: item.lwpoCd,
|
||||
name: item.lwpoCdNm
|
||||
}))
|
||||
.sort((a: Option, b: Option) => a.name.localeCompare(b.name, 'ko'));
|
||||
}));
|
||||
|
||||
set({ ctpv: ctpvList, sgg: sggList });
|
||||
} catch (e: any) {
|
||||
|
||||
Reference in New Issue
Block a user