diff --git a/CHANGELOG.md b/CHANGELOG.md index ac4ba04b5..3665b66ad 100644 --- a/CHANGELOG.md +++ b/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/), 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 diff --git a/apps/api/src/app/access/access.controller.ts b/apps/api/src/app/access/access.controller.ts index 35b1d485b..d692f358d 100644 --- a/apps/api/src/app/access/access.controller.ts +++ b/apps/api/src/app/access/access.controller.ts @@ -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