feat: article is not required now

This commit is contained in:
2024-05-21 13:49:22 +03:00
parent dea4ae6625
commit a21807c5a6
4 changed files with 4 additions and 4 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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 = () => {

View File

@@ -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 }