st: 검토 메뉴 grid footer 수정 및 누락 부분 추가
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
import type { SewerageSupplyRateItem } from "@/entities/statistics/model/statistics-input-interface";
|
||||
|
||||
export function toGridRows(items: SewerageSupplyRateItem[]): Record<string, string | number>[] {
|
||||
/**
|
||||
* 객체 배열을 그리드 row 형식으로 변환 (null/undefined → "").
|
||||
* 어떤 엔티티 타입이든 공통 사용 가능.
|
||||
*/
|
||||
export function toGridRows<T extends object>(
|
||||
items: T[]
|
||||
): Record<string, string | number>[] {
|
||||
return items.map((item) => {
|
||||
const row: Record<string, string | number> = {};
|
||||
for (const [key, value] of Object.entries(item)) {
|
||||
row[key] = value === null || value === undefined ? "" : value;
|
||||
row[key] =
|
||||
value === null || value === undefined ? "" : (value as string | number);
|
||||
}
|
||||
return row;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user