fix(OOO): Make the returned data more explicit

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2023-11-29 09:14:05 +01:00
parent 4d2a32a79b
commit aaaf0406b0
No known key found for this signature in database
GPG key ID: 74434EFE0D2E2205
2 changed files with 4 additions and 7 deletions

View file

@ -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);

View file

@ -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
}
}