Browse Source

Bugfix/improve error handling in access endpoints (#7392)

* Improve error handling

* Update changelog
pull/7391/head^2
Thomas Kaul 2 days ago
committed by GitHub
parent
commit
a20d394e0b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      CHANGELOG.md
  2. 4
      apps/api/src/app/access/access.controller.ts

6
CHANGELOG.md

@ -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/), 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). 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 ## 3.31.0 - 2026-07-20
### Changed ### Changed

4
apps/api/src/app/access/access.controller.ts

@ -87,7 +87,7 @@ export class AccessController {
} }
try { try {
return this.accessService.createAccess({ return await this.accessService.createAccess({
alias: data.alias || undefined, alias: data.alias || undefined,
granteeUser: data.granteeUserId granteeUser: data.granteeUserId
? { connect: { id: data.granteeUserId } } ? { connect: { id: data.granteeUserId } }
@ -155,7 +155,7 @@ export class AccessController {
} }
try { try {
return this.accessService.updateAccess({ return await this.accessService.updateAccess({
data: { data: {
alias: data.alias, alias: data.alias,
granteeUser: data.granteeUserId granteeUser: data.granteeUserId

Loading…
Cancel
Save