Skip to content

Commit a37e88f

Browse files
committed
Adding missing code for the form customizer tutorial
1 parent a197e90 commit a37e88f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/spfx/extensions/get-started/building-form-customizer.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,19 @@ Now that we have created the baseline component and tested that it works properl
370370
1. Add new method **_updateItem** to the **HelloWorldFormCustomizer** class.
371371

372372
```typescript
373-
373+
private _updateItem(title: string): Promise<SPHttpClientResponse> {
374+
return this.context.spHttpClient
375+
.post(this.context.pageContext.web.absoluteUrl + `/_api/web/lists/getByTitle('${this.context.list.title}')/items(${this.context.itemId})`, SPHttpClient.configurations.v1, {
376+
headers: {
377+
'content-type': 'application/json;odata.metadata=none',
378+
'if-match': this._etag,
379+
'x-http-method': 'MERGE'
380+
},
381+
body: JSON.stringify({
382+
Title: title
383+
})
384+
});
385+
}
374386
```
375387

376388
Now the code is complete to support minimal New, Edit and Display experiences and you can test out the different experiences using different configurations for debugging.

0 commit comments

Comments
 (0)