Skip to content

Commit 041783f

Browse files
feature: now the controller action is only returned when IsSuccess is true and result.Data is not null, preventing creation responses without valid data.
1 parent fc463a5 commit 041783f

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Boundaries/Comanda.Profiles/Source/Comanda.Profiles.WebApi/Controllers/OwnersController.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ public async Task<IActionResult> CreateOwnerAsync(
3838

3939
return result switch
4040
{
41-
{ IsSuccess: true } =>
41+
{ IsSuccess: true } when result.Data is not null =>
4242
StatusCode(StatusCodes.Status201Created, result.Data),
4343

44-
/* for tracking purposes: raise error #COMANDA-ERROR-76A71 */
4544
{ IsFailure: true } when result.Error == ProfileErrors.ProfileAlreadyExists =>
4645
StatusCode(StatusCodes.Status409Conflict, result.Error)
4746
};

0 commit comments

Comments
 (0)