feat: article is not required now
This commit is contained in:
		@@ -5,7 +5,7 @@
 | 
				
			|||||||
import type { BarcodeTemplateSchema } from './BarcodeTemplateSchema';
 | 
					import type { BarcodeTemplateSchema } from './BarcodeTemplateSchema';
 | 
				
			||||||
export type ProductCreateRequest = {
 | 
					export type ProductCreateRequest = {
 | 
				
			||||||
    name: string;
 | 
					    name: string;
 | 
				
			||||||
    article: string;
 | 
					    article?: (string | null);
 | 
				
			||||||
    clientId: number;
 | 
					    clientId: number;
 | 
				
			||||||
    barcodes: Array<string>;
 | 
					    barcodes: Array<string>;
 | 
				
			||||||
    barcodeTemplate?: (BarcodeTemplateSchema | null);
 | 
					    barcodeTemplate?: (BarcodeTemplateSchema | null);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,7 @@
 | 
				
			|||||||
import type { BarcodeTemplateSchema } from './BarcodeTemplateSchema';
 | 
					import type { BarcodeTemplateSchema } from './BarcodeTemplateSchema';
 | 
				
			||||||
export type ProductSchema = {
 | 
					export type ProductSchema = {
 | 
				
			||||||
    name: string;
 | 
					    name: string;
 | 
				
			||||||
    article: string;
 | 
					    article?: (string | null);
 | 
				
			||||||
    clientId: number;
 | 
					    clientId: number;
 | 
				
			||||||
    barcodes: Array<string>;
 | 
					    barcodes: Array<string>;
 | 
				
			||||||
    barcodeTemplate?: (BarcodeTemplateSchema | null);
 | 
					    barcodeTemplate?: (BarcodeTemplateSchema | null);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,7 +33,7 @@ const CreateProductModal = ({
 | 
				
			|||||||
        initialValues: initialValues,
 | 
					        initialValues: initialValues,
 | 
				
			||||||
        validate: {
 | 
					        validate: {
 | 
				
			||||||
            name: (name) => name.trim() !== '' ? null : "Необходимо ввести название товара",
 | 
					            name: (name) => name.trim() !== '' ? null : "Необходимо ввести название товара",
 | 
				
			||||||
            article: (article) => article.trim() !== '' ? null : "Необходимо ввести артикул",
 | 
					            // article: (article) => article.trim() !== '' ? null : "Необходимо ввести артикул",
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    const onCancelClick = () => {
 | 
					    const onCancelClick = () => {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
export type BaseProduct = {
 | 
					export type BaseProduct = {
 | 
				
			||||||
    name: string;
 | 
					    name: string;
 | 
				
			||||||
    article: string;
 | 
					    article?: string | null;
 | 
				
			||||||
    barcodes: string[];
 | 
					    barcodes: string[];
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
export type CreateProductRequest = BaseProduct & { clientId: number }
 | 
					export type CreateProductRequest = BaseProduct & { clientId: number }
 | 
				
			||||||
		Reference in New Issue
	
	Block a user