comment update

This commit is contained in:
Samandar Turgunboyev
2026-03-19 14:41:38 +05:00
parent 1851327f8a
commit 0c7a5127d0
4 changed files with 6 additions and 15 deletions

View File

@@ -58,7 +58,7 @@ export interface OrderCreateBody {
person_code: string;
currency_code: string;
owner_person_code: string;
note: string;
note?: string;
order_products: {
inventory_kind: string;
product_code: string;

View File

@@ -5,7 +5,7 @@ export const orderForm = z.object({
lat: z.string().min(1, { message: 'Majburiy maydon' }),
comment: z
.string()
.min(1, "Eng kamida 1ta belgi bo'lishi kerak")
// .min(1, "Eng kamida 1ta belgi bo'lishi kerak")
.max(300, 'Izoh 300 ta belgidan oshmasligi kerak'),
city: z.string().optional(),
});

View File

@@ -339,6 +339,7 @@ const OrderPage = () => {
}));
if (user) {
const dealTime = formatDate.format(deliveryDate, 'DD.MM.YYYY');
const note = value.comment.trim() ? value.comment : undefined;
mutate({
order: [
{
@@ -352,8 +353,8 @@ const OrderPage = () => {
person_code: user?.username,
currency_code: '860',
owner_person_code: user?.username,
note: value.comment,
order_products: order_products,
note: note,
},
],
});
@@ -454,11 +455,6 @@ const OrderPage = () => {
{t('Izoh 300 ta belgidan oshmasligi kerak')}
</p>
)}
{comment.length === 0 && (
<p className="text-red-500 text-md">
{t("Izoh kamida 1ta belgi bo'lishi kerak")}
</p>
)}
</FormItem>
);
}}

View File

@@ -375,7 +375,7 @@ const RefreshOrder = () => {
}));
if (user) {
const dealTime = formatDate.format(deliveryDate, 'DD.MM.YYYY');
const note = value.comment.trim() ? value.comment : undefined;
mutate({
order: [
{
@@ -389,7 +389,7 @@ const RefreshOrder = () => {
person_code: user?.username,
currency_code: '860',
owner_person_code: user?.username,
note: value.comment,
note: note,
order_products: order_products,
},
],
@@ -522,11 +522,6 @@ const RefreshOrder = () => {
{t('Izoh 300 ta belgidan oshmasligi kerak')}
</p>
)}
{comment.length === 0 && (
<p className="text-red-500 text-md">
{t("Izoh kamida 1ta belgi bo'lishi kerak")}
</p>
)}
</FormItem>
)}
/>