summaryrefslogtreecommitdiff
path: root/src/services/products
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-03-25 23:09:49 +0300
committereug-vs <eug-vs@keemail.me>2021-03-25 23:09:49 +0300
commit062f10a25d43b875d187cf582b2ecf96d075ec26 (patch)
treec6b43379325ba22a051827e6a461a8f8fed98402 /src/services/products
parent77ac1549e2ab5ac68a1a7464ada9be7e2a2aad92 (diff)
downloadcommercel-ui-062f10a25d43b875d187cf582b2ecf96d075ec26.tar.gz
refactor: move services to separate folder
Diffstat (limited to 'src/services/products')
-rw-r--r--src/services/products/ProductForm.tsx15
-rw-r--r--src/services/products/index.ts20
2 files changed, 35 insertions, 0 deletions
diff --git a/src/services/products/ProductForm.tsx b/src/services/products/ProductForm.tsx
new file mode 100644
index 0000000..62f0e70
--- /dev/null
+++ b/src/services/products/ProductForm.tsx
@@ -0,0 +1,15 @@
+import React from 'react';
+import { Form } from 'formik';
+import Input from '../../components/Input';
+
+
+const ProductForm: React.FC = () => {
+ return (
+ <Form id="form">
+ <Input name="name" label="Название" />
+ <Input name="price" type="number" label="Цена" />
+ </Form>
+ );
+};
+
+export default ProductForm;
diff --git a/src/services/products/index.ts b/src/services/products/index.ts
new file mode 100644
index 0000000..7e1509a
--- /dev/null
+++ b/src/services/products/index.ts
@@ -0,0 +1,20 @@
+import Form from './ProductForm';
+
+const service = {
+ route: 'products',
+ name: 'Товары',
+ nameSingular: 'Товар',
+ tableFields: [
+ { key: 'name', label: 'Название' },
+ { key: 'price', label: 'Цена' },
+ { key: 'quantity', label: 'На складе' },
+ ],
+ default: {
+ name: '',
+ price: '',
+ quantity: 0,
+ },
+ Form,
+};
+
+export default service;