Skip to content

Commit 9cfbd43

Browse files
committed
change code example for update object property example
1 parent ff2c00b commit 9cfbd43

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/ff-concepts/adding-customization/common-examples.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,13 @@ List<String> getProductReviewComments(ProductStruct product) {
222222
You can also modify the properties of an existing `ProductStruct` object. This can be helpful if you want to update a field before saving the data back to Firebase or passing it into an action.
223223
224224
- **Simple Property Modification**
225-
In this example, we’ll modify a single property, like `productId`, of an existing `ProductStruct` object. This example is straightforward and demonstrates how to update a basic field in the object.
225+
In this example, we’ll modify a single property, like `productName`, of an existing `ProductStruct` object. This example is straightforward and demonstrates how to update a basic field in the object.
226226
227227
```js
228-
// Function to update the product ID of a ProductStruct instance
229-
Future updateProductId(ProductStruct product, String newProductId) {
230-
// Update the product ID with the new value
231-
product.productId = newProductId;
228+
// Function to update the product name of a ProductStruct instance
229+
Future updateProductName(ProductStruct product, String newProductName) {
230+
// Update the product name with the new value
231+
product.productName = newProductName;
232232
}
233233
```
234234

0 commit comments

Comments
 (0)