diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c03107..8406737 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip ## [Unreleased] ### Added +- Add `MyContactsEndpoint` CRUD endpoints - Add `IdentifyScenarioVersion.ownConditions` - Add `MyAccount.shortName` - Add `MyEndpoint.info` endpoint and `MyInfo` resource diff --git a/src/Endpoint/MyContactsEndpoint.php b/src/Endpoint/MyContactsEndpoint.php index 402e843..d8e9f0b 100644 --- a/src/Endpoint/MyContactsEndpoint.php +++ b/src/Endpoint/MyContactsEndpoint.php @@ -4,6 +4,7 @@ namespace DigitalCz\DigiSign\Endpoint; +use DigitalCz\DigiSign\Endpoint\Traits\CRUDEndpointTrait; use DigitalCz\DigiSign\Resource\Collection; use DigitalCz\DigiSign\Resource\Contact; @@ -12,6 +13,9 @@ */ final class MyContactsEndpoint extends ResourceEndpoint { + /** @use CRUDEndpointTrait */ + use CRUDEndpointTrait; + public function __construct(MyEndpoint $parent) { parent::__construct($parent, '/contacts', Contact::class); diff --git a/tests/Endpoint/MyContactsEndpointTest.php b/tests/Endpoint/MyContactsEndpointTest.php index 07cdc02..26dc57f 100644 --- a/tests/Endpoint/MyContactsEndpointTest.php +++ b/tests/Endpoint/MyContactsEndpointTest.php @@ -15,6 +15,11 @@ public function testSuggest(): void self::assertLastRequest('GET', '/api/my/contacts/suggest?search=foo&limit=30'); } + public function testCRUD(): void + { + self::assertCrudRequests(self::endpoint(), '/api/my/contacts'); + } + protected static function endpoint(): MyContactsEndpoint { return self::dgs()->my()->contacts();