Closed peterpiek1 closed 9 months ago
zcli themes:import Theme imported successfully theme ID: 01234567-0123-0123-0123-0123456789ab ...
zcli themes:import
zcli themes:import Creating theme import job... ! › Error: TypeError - Value 360000123456 for /job/attributes/brand_id is of type number; expected string
360000123456
number
string
If there are multiple brands the brand_id value is converted to a string.
If there is only one brand the brand_id value returned is a number, see: https://github.com/zendesk/zcli/blob/fb0242c3d4ef04b3b9ad6cbfa2595439a07b35ca/packages/zcli-themes/src/lib/getBrandId.ts#L13C7-L13C26
Fix: change return brands[0].id to return brands[0].id.toString() Now the import succeeds.
return brands[0].id
return brands[0].id.toString()
Thanks for opening the issue 🙏🏼 Closing it as this as been fixed in 1.0.0-beta.36
Expectations
zcli themes:import
Theme imported successfully theme ID: 01234567-0123-0123-0123-0123456789ab ...Reality
zcli themes:import
Creating theme import job... ! › Error: TypeError - Value360000123456
for /job/attributes/brand_id is of typenumber
; expectedstring
Steps to Reproduce
zcli themes:import
Issue details
zcli themes:import
Possible solution
If there are multiple brands the brand_id value is converted to a string.
If there is only one brand the brand_id value returned is a number, see: https://github.com/zendesk/zcli/blob/fb0242c3d4ef04b3b9ad6cbfa2595439a07b35ca/packages/zcli-themes/src/lib/getBrandId.ts#L13C7-L13C26
Fix: change
return brands[0].id
toreturn brands[0].id.toString()
Now the import succeeds.