From ae3a83a7cbb481d84ca68ec0d0b6558de7d8aacb Mon Sep 17 00:00:00 2001 From: Awilum Date: Sat, 9 Apr 2022 00:15:38 +0300 Subject: [PATCH] feat(endpoints): add names for endpoints routes --- src/flextype/routes/endpoints/entries.php | 10 +++++----- src/flextype/routes/endpoints/registry.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/flextype/routes/endpoints/entries.php b/src/flextype/routes/endpoints/entries.php index c8998508..7cc22aa7 100644 --- a/src/flextype/routes/endpoints/entries.php +++ b/src/flextype/routes/endpoints/entries.php @@ -33,7 +33,7 @@ use function app; * Returns: * An array of entry objects. */ -app()->get('/api/v0/entries', [Entries::class, 'fetch']); +app()->get('/api/v0/entries', [Entries::class, 'fetch'])->setName('entries.fetch'); /** * Create entry @@ -49,7 +49,7 @@ app()->get('/api/v0/entries', [Entries::class, 'fetch']); * Returns: * Returns the entry object for the entry that was just created. */ -app()->post('/api/v0/entries', [Entries::class, 'create']); +app()->post('/api/v0/entries', [Entries::class, 'create'])->setName('entries.create'); /** * Update entry @@ -65,7 +65,7 @@ app()->post('/api/v0/entries', [Entries::class, 'create']); * Returns: * Returns the entry object for the entry that was just updated. */ -app()->patch('/api/v0/entries', [Entries::class, 'update']); +app()->patch('/api/v0/entries', [Entries::class, 'update'])->setName('entries.update'); /** * Move entry @@ -97,7 +97,7 @@ app()->put('/api/v0/entries', [Entries::class, 'move']); * Returns: * Returns the entry object for the entry that was just copied. */ -app()->put('/api/v0/entries/copy', [Entries::class, 'copy']); +app()->put('/api/v0/entries/copy', [Entries::class, 'copy'])->setName('entries.copy'); /** * Delete entry @@ -112,4 +112,4 @@ app()->put('/api/v0/entries/copy', [Entries::class, 'copy']); * Returns: * Returns an empty body with HTTP status 204 */ -app()->delete('/api/v0/entries', [Entries::class, 'delete']); +app()->delete('/api/v0/entries', [Entries::class, 'delete'])->setName('entries.delete'); diff --git a/src/flextype/routes/endpoints/registry.php b/src/flextype/routes/endpoints/registry.php index 2937206a..5f7217b6 100644 --- a/src/flextype/routes/endpoints/registry.php +++ b/src/flextype/routes/endpoints/registry.php @@ -33,4 +33,4 @@ use function app; * Returns: * An array of registry objects. */ -app()->get('/api/v0/registry', [Registry::class, 'get']); +app()->get('/api/v0/registry', [Registry::class, 'get'])->setName('registry.get');