Skip to content

Commit

Permalink
fix(dav): Use IUser::getDisplayName directly
Browse files Browse the repository at this point in the history
No need to send this from the client.

Signed-off-by: Christoph Wurst <[email protected]>

Signed-off-by: nextcloud-command <[email protected]>

[skip ci]
  • Loading branch information
ChristophWurst authored and backportbot[bot] committed Mar 5, 2025
1 parent 60821a7 commit ce264e9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
3 changes: 2 additions & 1 deletion apps/dav/lib/Controller/OutOfOfficeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public function setOutOfOffice(
return new DataResponse(null, Http::STATUS_UNAUTHORIZED);
}

$replacementUser = null;
if ($replacementUserId !== null) {
$replacementUser = $this->userManager->get($replacementUserId);
if ($replacementUser === null) {
Expand All @@ -149,7 +150,7 @@ public function setOutOfOffice(
$status,
$message,
$replacementUserId,
$replacementUserDisplayName
$replacementUser?->getDisplayName()
);
$this->coordinator->clearCache($user->getUID());

Expand Down
5 changes: 0 additions & 5 deletions apps/dav/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@
"type": "string",
"nullable": true,
"description": "User id of the replacement user"
},
"replacementUserDisplayName": {
"type": "string",
"nullable": true,
"description": "Display name of the replacement user"
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions apps/dav/src/components/AbsenceForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ export default {
lastDay: formatDateAsYMD(this.lastDay),
status: this.status,
message: this.message,
replacementUserId: this.replacementUser?.user ?? null,
replacementUserDisplayName: this.replacementUser?.displayName ?? null,
replacementUserId: this.replacementUser?.user ?? null
})
showSuccess(this.$t('dav', 'Absence saved'))
} catch (error) {
Expand Down

0 comments on commit ce264e9

Please sign in to comment.