mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix(OOO): Make the returned data more explicit
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
4d2a32a79b
commit
aaaf0406b0
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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue