Merge pull request #41845 from nextcloud/backport/41818/stable28

[stable28] fix(OOO): Make the returned data more explicit
pull/41873/head
Andy Scherzinger 2023-11-29 15:20:31 +07:00 committed by GitHub
commit ec962bb7c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

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

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