fix(admin-panel): retail order status editing posted a body with no orderId
views/order/List.vue handed the timeline activity entry straight to
single/order-sts/edit. That entry is {status, title, proceed, uaj, note} and has
no order id, so UpdateOrderStatusDto rejected every call with 400 — neither
"ثبت وضعیت" nor "حذف وضعیت" worked on the retail order screen. Both handlers now
take the id from tempRow, matching OmdeList.vue and TaminList.vue, which were
already correct.
Found by the new scripts/smoke-admin.cjs (43/43), which walks login, customer
create, sales-expert create/edit, product+variant create/edit and order
list/detail/status, asserting the database changed rather than trusting a 200.
[ref: henza_server/routes/admin.php:59]
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
676ec3ed72
commit
0983c42788
@@ -198,9 +198,22 @@ async function loadDetail(id: string) {
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Both handlers receive one ACTIVITY entry from the timeline
|
||||
* (`{status, title, proceed, uaj, note}` — admin-orders.service.ts:249-258),
|
||||
* which carries no order id. Posting that object straight through left
|
||||
* `orderId` missing and UpdateOrderStatusDto rejected every call with 400, so
|
||||
* neither "ثبت وضعیت" nor "حذف وضعیت" worked on this screen at all. The id
|
||||
* comes from `tempRow`, the order loaded when the dialog opened. OmdeList.vue
|
||||
* already built its body this way (OmdeList.vue:187).
|
||||
*/
|
||||
async function setSts(row: Record<string, any>) {
|
||||
try {
|
||||
await api.post('single/order-sts/edit', row);
|
||||
await api.post('single/order-sts/edit', {
|
||||
orderId: tempRow.value?.id,
|
||||
status: row.status,
|
||||
note: row.note,
|
||||
});
|
||||
visibleSts.value = false;
|
||||
message.info('ویرایش موفق آمیز');
|
||||
tbl.value?.fetch();
|
||||
@@ -211,8 +224,12 @@ async function setSts(row: Record<string, any>) {
|
||||
|
||||
async function removeSts(row: Record<string, any>) {
|
||||
try {
|
||||
row.remove = true;
|
||||
await api.post('single/order-sts/edit', row);
|
||||
await api.post('single/order-sts/edit', {
|
||||
orderId: tempRow.value?.id,
|
||||
status: row.status,
|
||||
note: row.note,
|
||||
remove: true,
|
||||
});
|
||||
visibleSts.value = false;
|
||||
message.info('ویرایش موفق آمیز');
|
||||
tbl.value?.fetch();
|
||||
|
||||
Reference in New Issue
Block a user