comment update
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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(),
|
||||
});
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}}
|
||||
|
||||
@@ -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>
|
||||
)}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user