diff options
author | Andy Scherzinger <info@andy-scherzinger.de> | 2023-11-29 10:49:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-29 10:49:17 +0100 |
commit | 6e3781b48632cdbe346a3d8627c54375b7265e3e (patch) | |
tree | 6fecbc866db55a386bbf5ae1d6c2ff2e98b0bb84 | |
parent | 16de85d8bbe3d916ac3f70577133ae869ba6474e (diff) | |
parent | aaaf0406b0e458af7221a42e16ebd094a258715b (diff) | |
download | nextcloud-server-6e3781b48632cdbe346a3d8627c54375b7265e3e.tar.gz nextcloud-server-6e3781b48632cdbe346a3d8627c54375b7265e3e.zip |
Merge pull request #41818 from nextcloud/techdebt/noid/clarify-ooo-return-data
fix(OOO): Make the returned data more explicit
-rw-r--r-- | apps/dav/lib/Controller/OutOfOfficeController.php | 7 | ||||
-rw-r--r-- | apps/dav/openapi.json | 4 |
2 files changed, 4 insertions, 7 deletions
diff --git a/apps/dav/lib/Controller/OutOfOfficeController.php b/apps/dav/lib/Controller/OutOfOfficeController.php index fe4200ee1b5..e86f116c3b1 100644 --- a/apps/dav/lib/Controller/OutOfOfficeController.php +++ b/apps/dav/lib/Controller/OutOfOfficeController.php @@ -30,6 +30,7 @@ use OCA\DAV\Db\AbsenceMapper; use OCA\DAV\ResponseDefinitions; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCSController; use OCP\IRequest; @@ -50,15 +51,13 @@ class OutOfOfficeController extends OCSController { /** * Get the currently configured out-of-office data of a user. * - * @NoAdminRequired - * @NoCSRFRequired - * * @param string $userId The user id to get out-of-office data for. - * @return DataResponse<Http::STATUS_OK|Http::STATUS_NOT_FOUND, ?DAVOutOfOfficeData, array{}> + * @return DataResponse<Http::STATUS_OK, DAVOutOfOfficeData, array{}>|DataResponse<Http::STATUS_NOT_FOUND, null, array{}> * * 200: Out-of-office data * 404: No out-of-office data was found */ + #[NoAdminRequired] public function getCurrentOutOfOfficeData(string $userId): DataResponse { try { $data = $this->absenceMapper->findByUserId($userId); diff --git a/apps/dav/openapi.json b/apps/dav/openapi.json index 994d0cde11d..c8ae5a96206 100644 --- a/apps/dav/openapi.json +++ b/apps/dav/openapi.json @@ -277,8 +277,7 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "$ref": "#/components/schemas/OutOfOfficeData", - "nullable": true + "$ref": "#/components/schemas/OutOfOfficeData" } } } @@ -308,7 +307,6 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "$ref": "#/components/schemas/OutOfOfficeData", "nullable": true } } |