File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -631,12 +631,19 @@ export function Stack (http, data) {
631
631
* .then((settings) => console.log(settings))
632
632
*
633
633
*/
634
- this . addSettings = async ( variables = { } ) => {
634
+ this . addSettings = async ( stackVariables = { } ) => {
635
635
try {
636
- const response = await http . post ( `${ this . urlPath } /settings` , { stack_settings : variables } ,
637
- { headers : {
638
- ...cloneDeep ( this . stackHeaders )
639
- } } )
636
+ const payloadBody = (
637
+ 'stack_variables' in stackVariables ||
638
+ 'live_preview' in stackVariables ||
639
+ 'rte' in stackVariables
640
+ )
641
+ ? { stack_settings : stackVariables }
642
+ : { stack_settings : { stack_variables : stackVariables } }
643
+
644
+ const response = await http . post ( `${ this . urlPath } /settings` , payloadBody , { headers : {
645
+ ...cloneDeep ( this . stackHeaders )
646
+ } } )
640
647
if ( response . data ) {
641
648
return response . data . stack_settings
642
649
} else {
You can’t perform that action at this time.
0 commit comments