File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
client/src/backend/containers/resource Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -44,12 +44,17 @@ export class ResourcePropertiesContainer extends PureComponent {
4444 } ;
4545
4646 render ( ) {
47- const resource = this . props . resource . attributes ;
48- const t = this . props . t ;
47+ const { resource, t } = this . props ;
48+ const { attributes } = resource ?? { } ;
49+ const sortOrderBool = ! ! attributes ?. sortOrder ;
50+
4951 return (
5052 < section >
5153 < FormContainer . Form
52- model = { this . props . resource }
54+ model = { {
55+ ...resource ,
56+ attributes : { ...resource . attributes , sortOrder : sortOrderBool }
57+ } }
5358 name = "backend-resource-update"
5459 update = { resourcesAPI . update }
5560 create = { model =>
@@ -69,7 +74,7 @@ export class ResourcePropertiesContainer extends PureComponent {
6974 < Form . Switch
7075 label = { t ( "resources.properties.sort_order_label" ) }
7176 name = "attributes[sortOrder]"
72- value = { ! ! resource . sortOrder }
77+ value = { sortOrderBool }
7378 placeholder = { t ( "resources.properties.sort_order_placeholder" ) }
7479 instructions = { t ( "resources.properties.sort_order_instructions" ) }
7580 />
You can’t perform that action at this time.
0 commit comments