Skip to content

Commit c4d512f

Browse files
authored
Merge pull request #686 from alanbiju79/update-setCookieData-documentation-example
docs: fix invalid/outdated method in code block
2 parents a285740 + 2d65695 commit c4d512f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/reference/api-reference.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -464,30 +464,30 @@ Save custom data into the cookie. Returns `true` if the data was set successfull
464464
465465
```javascript
466466
// First set: true
467-
CookieConsent.setData({
467+
CookieConsent.setCookieData({
468468
value: {id: 21, lang: 'it'}
469469
}); //{id: 21, lang: 'it'}
470470
471471
// Change only the 'id' field: true
472-
CookieConsent.setData({
472+
CookieConsent.setCookieData({
473473
value: {id: 22},
474474
mode: 'update'
475475
}); //{id: 22, lang: 'it'}
476476
477477
// Add a new field: true
478-
CookieConsent.setData({
478+
CookieConsent.setCookieData({
479479
value: {newField: 'newValue'},
480480
mode: 'update'
481481
}); //{id: 22, lang: 'it', newField: 'newValue'}
482482
483483
// Change 'id' to a string value: FALSE
484-
CookieConsent.setData({
484+
CookieConsent.setCookieData({
485485
value: {id: 'hello'},
486486
mode: 'update'
487487
}); //{id: 22, lang: 'it', newField: 'newValue'}
488488
489489
// Overwrite: true
490-
CookieConsent.setData({
490+
CookieConsent.setCookieData({
491491
value: 'overwriteEverything'
492492
}); // 'overwriteEverything'
493493
```

0 commit comments

Comments
 (0)