aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-11-04 11:18:30 -0300
committerSebastian <sebasjm@gmail.com>2022-11-04 11:56:05 -0300
commita69e559890d888d10739c8e29549ff37b788743a (patch)
tree87c0c3976f64ece357e2de2b9727c07ee87dcf78 /packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx
parent80ab8ccce9a9ce46b445d0857769aadd640073a3 (diff)
downloadwallet-core-a69e559890d888d10739c8e29549ff37b788743a.tar.xz
better type signature for undefinedIfEmpty
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx')
-rw-r--r--packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx7
1 files changed, 1 insertions, 6 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx
index fa0dd7a5a..56bb65b90 100644
--- a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/CreatePage.tsx
@@ -42,6 +42,7 @@ import { InventoryProductForm } from "../../../../components/product/InventoryPr
import { NonInventoryProductFrom } from "../../../../components/product/NonInventoryProductForm.js";
import { InputNumber } from "../../../../components/form/InputNumber.js";
import { InputBoolean } from "../../../../components/form/InputBoolean.js";
+import { undefinedIfEmpty } from "../../../../utils/table.js";
interface Props {
onCreate: (d: MerchantBackend.Orders.PostOrderRequest) => void;
@@ -126,12 +127,6 @@ const stringIsValidJSON = (value: string) => {
}
};
-function undefinedIfEmpty<T>(obj: T): T | undefined {
- return Object.keys(obj).some((k) => (obj as any)[k] !== undefined)
- ? obj
- : undefined;
-}
-
export function CreatePage({
onCreate,
onBack,