fix(admin-ui): Allow backorder update on variants (#4051)

This commit is contained in:
Philip Korsholm
2023-05-16 17:28:45 +02:00
committed by GitHub
parent 4fb443c0ea
commit 2945769497
7 changed files with 40 additions and 23 deletions

View File

@@ -1,2 +1,11 @@
export const removeNullish = (obj: Record<string, unknown>) =>
export const removeFalsy = (obj: Record<string, unknown>) =>
Object.entries(obj).reduce((a, [k, v]) => (v ? ((a[k] = v), a) : a), {})
// == null is also true for undefined
export const removeNullish = (
obj: Record<string, unknown>
): Record<string, unknown> =>
Object.entries(obj).reduce(
(a, [k, v]) => (v != null ? ((a[k] = v), a) : a),
{}
)