
# Class: UpdateSurfacesCommand

A command that replaces product pages.

Here, we replace the first page of the loaded product with the third page of a state file.
```
{
  "type": "design-editor",
  "name": "editor",
  "params": {
    "initial": { ... },
    "updateSurfaces": [{
        "definition": "{{ $['options']._.props.id  }}",
        "surfaces": [0],
        "newProductSurfaces": [2],
        "replaceAll": true
    }]
  }
}
```

## Hierarchy

* [DesignEditorWidgetCommand](designeditorwidgetcommand.md)

  ↳ **UpdateSurfacesCommand**

## Index

### Methods

* [execute](updatesurfacescommand.md#execute)

## Methods

###  execute

▸ **execute**(`params`: [IUpdateSurfacesCommandDefinition](../interfaces/iupdatesurfacescommanddefinition.md)[] | [IUpdateSurfacesCommandDefinition](../interfaces/iupdatesurfacescommanddefinition.md)): *Promise‹void›*

*Overrides [DesignEditorWidgetCommand](designeditorwidgetcommand.md).[execute](designeditorwidgetcommand.md#abstract-execute)*

Executes this command.

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`params` | [IUpdateSurfacesCommandDefinition](../interfaces/iupdatesurfacescommanddefinition.md)[] &#124; [IUpdateSurfacesCommandDefinition](../interfaces/iupdatesurfacescommanddefinition.md) | Parameters for the command.  |

**Returns:** *Promise‹void›*
