17 lines
359 B
TypeScript
17 lines
359 B
TypeScript
import type { selectArray } from "@/app/store/common/code";
|
|
|
|
|
|
|
|
|
|
|
|
export const getCity = (val: string, sggCd: selectArray[]) => {
|
|
const data = sggCd
|
|
.filter((item) => String(item.val).substring(0, 2) === val)
|
|
.map((item) => ({
|
|
val: String(item.val),
|
|
text: item.text // 한국어 텍스트
|
|
}));
|
|
return data
|
|
|
|
};
|