feat(core-flows,dashboard): adds item validations for claims, returns and exchanges (#8735)
what: - adds item validations for claims, returns and exchanges - prevents autofocus on item add - reset item quantity when error
This commit is contained in:
@@ -427,6 +427,30 @@ medusaIntegrationTestRunner({
|
||||
},
|
||||
adminHeaders
|
||||
)
|
||||
|
||||
const { response } = await api
|
||||
.post(`/admin/exchanges/${exchangeId2}/request`, {}, adminHeaders)
|
||||
.catch((e) => e)
|
||||
|
||||
expect(response.data).toEqual({
|
||||
type: "invalid_data",
|
||||
message:
|
||||
"Order exchange request should have atleast 1 item inbound and 1 item outbound",
|
||||
})
|
||||
|
||||
await api.post(
|
||||
`/admin/exchanges/${exchangeId2}/outbound/items`,
|
||||
{
|
||||
items: [
|
||||
{
|
||||
variant_id: productExtra.variants[0].id,
|
||||
quantity: 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
adminHeaders
|
||||
)
|
||||
|
||||
await api.post(
|
||||
`/admin/exchanges/${exchangeId2}/request`,
|
||||
{},
|
||||
|
||||
Reference in New Issue
Block a user