Browse Source
Bugfix/improve error handling in access endpoints (#7392)
* Improve error handling
* Update changelog
pull/7391/head^2
Thomas Kaul
1 day ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
8 additions and
2 deletions
-
CHANGELOG.md
-
apps/api/src/app/access/access.controller.ts
|
|
|
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. |
|
|
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
|
|
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
|
|
|
|
|
|
|
## Unreleased |
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Improved the error handling in the access endpoints (`POST` and `PUT`) to return `400 Bad Request` when granting access to a non-existent user |
|
|
|
|
|
|
|
## 3.31.0 - 2026-07-20 |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
|
|
@ -87,7 +87,7 @@ export class AccessController { |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
return this.accessService.createAccess({ |
|
|
|
return await this.accessService.createAccess({ |
|
|
|
alias: data.alias || undefined, |
|
|
|
granteeUser: data.granteeUserId |
|
|
|
? { connect: { id: data.granteeUserId } } |
|
|
|
@ -155,7 +155,7 @@ export class AccessController { |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
return this.accessService.updateAccess({ |
|
|
|
return await this.accessService.updateAccess({ |
|
|
|
data: { |
|
|
|
alias: data.alias, |
|
|
|
granteeUser: data.granteeUserId |
|
|
|
|