comment update
This commit is contained in:
@@ -58,7 +58,7 @@ export interface OrderCreateBody {
|
|||||||
person_code: string;
|
person_code: string;
|
||||||
currency_code: string;
|
currency_code: string;
|
||||||
owner_person_code: string;
|
owner_person_code: string;
|
||||||
note: string;
|
note?: string;
|
||||||
order_products: {
|
order_products: {
|
||||||
inventory_kind: string;
|
inventory_kind: string;
|
||||||
product_code: string;
|
product_code: string;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export const orderForm = z.object({
|
|||||||
lat: z.string().min(1, { message: 'Majburiy maydon' }),
|
lat: z.string().min(1, { message: 'Majburiy maydon' }),
|
||||||
comment: z
|
comment: z
|
||||||
.string()
|
.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'),
|
.max(300, 'Izoh 300 ta belgidan oshmasligi kerak'),
|
||||||
city: z.string().optional(),
|
city: z.string().optional(),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -339,6 +339,7 @@ const OrderPage = () => {
|
|||||||
}));
|
}));
|
||||||
if (user) {
|
if (user) {
|
||||||
const dealTime = formatDate.format(deliveryDate, 'DD.MM.YYYY');
|
const dealTime = formatDate.format(deliveryDate, 'DD.MM.YYYY');
|
||||||
|
const note = value.comment.trim() ? value.comment : undefined;
|
||||||
mutate({
|
mutate({
|
||||||
order: [
|
order: [
|
||||||
{
|
{
|
||||||
@@ -352,8 +353,8 @@ const OrderPage = () => {
|
|||||||
person_code: user?.username,
|
person_code: user?.username,
|
||||||
currency_code: '860',
|
currency_code: '860',
|
||||||
owner_person_code: user?.username,
|
owner_person_code: user?.username,
|
||||||
note: value.comment,
|
|
||||||
order_products: order_products,
|
order_products: order_products,
|
||||||
|
note: note,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
@@ -454,11 +455,6 @@ const OrderPage = () => {
|
|||||||
{t('Izoh 300 ta belgidan oshmasligi kerak')}
|
{t('Izoh 300 ta belgidan oshmasligi kerak')}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{comment.length === 0 && (
|
|
||||||
<p className="text-red-500 text-md">
|
|
||||||
{t("Izoh kamida 1ta belgi bo'lishi kerak")}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ const RefreshOrder = () => {
|
|||||||
}));
|
}));
|
||||||
if (user) {
|
if (user) {
|
||||||
const dealTime = formatDate.format(deliveryDate, 'DD.MM.YYYY');
|
const dealTime = formatDate.format(deliveryDate, 'DD.MM.YYYY');
|
||||||
|
const note = value.comment.trim() ? value.comment : undefined;
|
||||||
mutate({
|
mutate({
|
||||||
order: [
|
order: [
|
||||||
{
|
{
|
||||||
@@ -389,7 +389,7 @@ const RefreshOrder = () => {
|
|||||||
person_code: user?.username,
|
person_code: user?.username,
|
||||||
currency_code: '860',
|
currency_code: '860',
|
||||||
owner_person_code: user?.username,
|
owner_person_code: user?.username,
|
||||||
note: value.comment,
|
note: note,
|
||||||
order_products: order_products,
|
order_products: order_products,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -522,11 +522,6 @@ const RefreshOrder = () => {
|
|||||||
{t('Izoh 300 ta belgidan oshmasligi kerak')}
|
{t('Izoh 300 ta belgidan oshmasligi kerak')}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{comment.length === 0 && (
|
|
||||||
<p className="text-red-500 text-md">
|
|
||||||
{t("Izoh kamida 1ta belgi bo'lishi kerak")}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user