9c8d5f2cad
订单佣金只认关联用户;合伙人备注写入独立表;H5 增加用户管理与首页统计。 Co-authored-by: Cursor <cursoragent@cursor.com>
10 lines
381 B
TypeScript
10 lines
381 B
TypeScript
/** 表单选填项常为 null,PUT 时去掉以免后端对 null 调 trim */
|
|
export function omitNullFields<T extends Record<string, unknown>>(input: T): Partial<T> {
|
|
const out: Partial<T> = {};
|
|
for (const [key, value] of Object.entries(input)) {
|
|
if (value === null || value === undefined) continue;
|
|
(out as Record<string, unknown>)[key] = value;
|
|
}
|
|
return out;
|
|
}
|