You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -368,22 +368,24 @@ You may need to add custom logic to your API which can do with using the followi
368
368
369
369
For example the following implementation of the `onEditBeforeWrite()` hook will update the `Content` field of a DataObject updated via a `PATCH` request before saving, even though the `Content` field is not exposed in the API.
370
370
371
+
Note to run this code example you need to be logged in to the CMS to use and pass an `X-CSRF-TOKEN` header when making requests.
372
+
371
373
**src/MySiteTreeEndpoint.php**
372
374
373
375
```php
374
376
<?php
375
377
376
-
use emteknetnz\RestApi\RestApiEndpoint;
378
+
use emteknetnz\RestApi\Controllers\RestApiEndpoint;
0 commit comments