saleor-dashboard
saleor-dashboard copied to clipboard
productBulkDelete mutation fails with more than 20 products
Originally created by @simon-online in saleor/saleor.
What I'm trying to achieve
Delete more than 20 products
Steps to reproduce the problem
- Go to
/dashboard/products
- Change "No of rows" to more than 20
- Select all products
- Try to delete them
What I expected to happen
I am able to delete the products successfully
Screenshots
https://user-images.githubusercontent.com/44495184/182540971-f7d70660-a1fb-4246-a52c-b884ed0fb465.mov
The cause
As @simon-online described, there is an issue with how the dashboard sends the product IDs:
For a small number of selected products to delete which is successful variables looks like this:
{
variables: {
ids: ["UHJvZHVjdDoxMTI=", "UHJvZHVjdDoxMTE="]
}
}
But when a request for a larger number (eg. 40) of selected products to delete is made it fails and it looks like this:
{
variables: {
ids: [{0: "UHJvZHVjdDo3Mg==", 1: "UHJvZHVjdDo3NA==", 2: "UHJvZHVjdDoxMjI=", 3: "UHJvZHVjdDo3OQ==",…}]
}
}
System information
Saleor version:
- [x] v3.5.0
@simon-online moved your issue here.