Closed beriniwlew closed 7 years ago
hmmmmmm.
The posted data is FormUrl encoded so it should look something like this:
user_key=...dummy USER key...&
category_id=111&
default=1&
templates_copyable=1&
label[en_US]=My Category&
label[fr_FR]=Ma Catégorie
I'm guessing you converted it to JSON so it's easier to visualize?
But anyway, as far as I know label[<label>]=<value>&label[<label>]=<value>
is the correct syntax. That's how we send all arrays to the CakeMail API.
What is the error you're getting?
I just compared how we handle the labels when creating a category with how we handle them when updating a category and I immediately noticed a difference:
when creating a category, here's the data we post to CakeMail:
label[0][language]=en_US&
label[0][name]=My Category&
label[1][language]=fr_FR&
label[1][name]=Ma Catégorie
as you can see the "language" and the "name" are handled separately.
This leads me to conclude that the way we handle labels when updating a category is wrong.
When updating a category, it produces the following post data.
but it should be this
Note that the labels should be an array.
I'm having an issue updating the templates as well.