Skip to content

Commit

Permalink
Merge pull request #41818 from nextcloud/techdebt/noid/clarify-ooo-re…
Browse files Browse the repository at this point in the history
…turn-data

fix(OOO): Make the returned data more explicit
  • Loading branch information
AndyScherzinger authored Nov 29, 2023
2 parents 16de85d + aaaf040 commit 6e3781b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 3 additions & 4 deletions apps/dav/lib/Controller/OutOfOfficeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
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;
Expand All @@ -50,15 +51,13 @@ public function __construct(
/**
* 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);
Expand Down
4 changes: 1 addition & 3 deletions apps/dav/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,7 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"$ref": "#/components/schemas/OutOfOfficeData",
"nullable": true
"$ref": "#/components/schemas/OutOfOfficeData"
}
}
}
Expand Down Expand Up @@ -308,7 +307,6 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"$ref": "#/components/schemas/OutOfOfficeData",
"nullable": true
}
}
Expand Down

0 comments on commit 6e3781b

Please sign in to comment.