aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-11-29 09:14:05 +0100
committerJoas Schilling <coding@schilljs.com>2023-11-29 09:14:05 +0100
commitaaaf0406b0e458af7221a42e16ebd094a258715b (patch)
treeb881fb344661116380b353641e62680d1ceabd22 /apps
parent4d2a32a79b316042f2dd6cc89b14c65527f3ae08 (diff)
downloadnextcloud-server-aaaf0406b0e458af7221a42e16ebd094a258715b.tar.gz
nextcloud-server-aaaf0406b0e458af7221a42e16ebd094a258715b.zip
fix(OOO): Make the returned data more explicit
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/Controller/OutOfOfficeController.php7
-rw-r--r--apps/dav/openapi.json4
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
}
}