Return 404 instead of 500 when an "original parent" has been deleted (#15990)

This commit is contained in:
Kenn Jacobsen
2024-04-05 12:49:24 +02:00
committed by GitHub
parent 3cc14888a9
commit c6f1189418

View File

@@ -88,7 +88,7 @@ public abstract class RecycleBinControllerBase<TItem> : ContentControllerBase
.WithTitle($"The {contentType} is not trashed")
.WithDetail($"The {contentType} needs to be trashed for the parent-before-recycled relation to be created.")
.Build()),
RecycleBinQueryResultType.NoParentRecycleRelation => StatusCode(StatusCodes.Status500InternalServerError, problemDetailsBuilder
RecycleBinQueryResultType.NoParentRecycleRelation => NotFound(problemDetailsBuilder
.WithTitle("The parent relation could not be found")
.WithDetail($"The relation between the parent and the {contentType} that should have been created when the {contentType} was deleted could not be found.")
.Build()),