Rename shared api

pull/37/head
Varun Patil 2022-08-16 04:02:19 +00:00
parent 3c0858b706
commit 37002f1721
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ return [
// API // API
['name' => 'api#days', 'url' => '/api/days', 'verb' => 'GET'], ['name' => 'api#days', 'url' => '/api/days', 'verb' => 'GET'],
['name' => 'api#day', 'url' => '/api/days/{id}', 'verb' => 'GET'], ['name' => 'api#day', 'url' => '/api/days/{id}', 'verb' => 'GET'],
['name' => 'api#shared', 'url' => '/api/shared/{folder}', 'verb' => 'GET'], ['name' => 'api#folder', 'url' => '/api/folder/{folder}', 'verb' => 'GET'],
['name' => 'api#sharedDay', 'url' => '/api/shared/{folder}/{dayId}', 'verb' => 'GET'], ['name' => 'api#folderDay', 'url' => '/api/folder/{folder}/{dayId}', 'verb' => 'GET'],
] ]
]; ];

View File

@ -94,7 +94,7 @@ class ApiController extends Controller {
* *
* @return JSONResponse * @return JSONResponse
*/ */
public function shared(string $folder): JSONResponse { public function folder(string $folder): JSONResponse {
$user = $this->userSession->getUser(); $user = $this->userSession->getUser();
if (is_null($user) || !is_numeric($folder)) { if (is_null($user) || !is_numeric($folder)) {
return new JSONResponse([], Http::STATUS_PRECONDITION_FAILED); return new JSONResponse([], Http::STATUS_PRECONDITION_FAILED);
@ -110,7 +110,7 @@ class ApiController extends Controller {
* *
* @return JSONResponse * @return JSONResponse
*/ */
public function sharedDay(string $folder, string $dayId): JSONResponse { public function folderDay(string $folder, string $dayId): JSONResponse {
$user = $this->userSession->getUser(); $user = $this->userSession->getUser();
if (is_null($user) || !is_numeric($folder) || !is_numeric($dayId)) { if (is_null($user) || !is_numeric($folder) || !is_numeric($dayId)) {
return new JSONResponse([], Http::STATUS_PRECONDITION_FAILED); return new JSONResponse([], Http::STATUS_PRECONDITION_FAILED);